how to clear residual garbage in a stack?

Brian Milby brian at
Tue May 22 15:26:58 EDT 2018

I can reproduce the time issue (100 cards - 8.5MB file - 71s), but not the
space issue. Have a button copy a card and paste it 100 times and then
“save this stack”. Another button deletes the last card until there is only
one left and then does the same. File size goes to 85kb in 673ms. This is
on Win10, LC9 Business. Stack size largely due to a single field with a
bunch of text in it.
On Tue, May 22, 2018 at 12:18 PM Richard Gaskin via use-livecode <
use-livecode at> wrote:

> Neville Smythe wrote:
>  > Actually I just did a hex dump of the 8MB file saved from the 1 card
>  > stack; and lo! it has an EOF at about the 28KB position, at which
>  > point BBEdit stops dumping the file; up to that point it appears to be
>  > the correct data for a 1 card stack, no extraneous garbage. But the
>  > system reports it as an 8MB file. Doesn’t that mean the file was not
>  > closed correctly by the save stack command, or that compact stack is
>  > not working correctly to reduce the internal memory and save stack is
>  > blindly writing bytes beyond the EOF, so either way it is a bug?
> Possibly.  Or it may be an error in the disk driver or a corruption in
> the file system.
> EOF is not normally written to a file (at least not since the old CP/M
> days).  My understanding is that modern file systems allow the OS to
> know where the file ends by the length record in the inode; EOF is sent
> only as a flag by the OS during read operations.
> I wonder if BBEdit's issue is that it's reading the file as text rather
> than binary, in which case it may be interpreting some binary elements
> as the OS-defined EOF constant.
> If you read the stack file as binary in LC what is the length of the data?
> --
>   Richard Gaskin
>   Fourth World Systems
>   Software Design and Development for the Desktop, Mobile, and the Web
>   ____________________________________________________________________
>   Ambassador at      
> _______________________________________________
> use-livecode mailing list
> use-livecode at
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:

More information about the use-livecode mailing list