primitiveFileSize on mac/unix

Avi Bryant avi.bryant at gmail.com
Mon May 2 11:33:37 UTC 2005


I think this may have come up before, but: on the Unix or Mac (Carbon)
VMs, a FileStream will always return the #size it had when it was
opened, or the last time that FileStream instance was written to - it
doesn't notice if some other process or even some other FileStream
instance appends to the file.  It will happily read those bytes,
however, which means that it's possible for "file position > file size
and: [file next notNil]" to be true, which seems rather inconsistent.

Right now the only way to find out the true size of a file is to open
a new FileStream on it, which is a pretty expensive way to do it.

Is there any reason it has to be this way?  Is there any chance we can fix it?

Avi



More information about the Squeak-dev mailing list