file size primitive bug?

tim Rowledge tim at sumeru.stanford.edu
Thu Feb 26 21:28:48 UTC 2004


Julian Fitzell wrote:

> I've encountered a problem, while using OmniBase, in that squeak 
> returns an incorrect file size if the size has changed since it was 
> opened. This appears to be because the file size is returned from a 
> rarely-updated file structure.  I have solved this by changing 
> sqFileSize() to get a file descriptor with "fileno(f->file)" and then 
> using fstat() to get the file size.

It's pretty horrible isn't it. I've never been able to work out why it 
would be done like that. The size value  is only increased by writing to 
the file; thus if you have two accessors on the same file (haven't I 
complained about this before?) it is quite possible for one to claim the 
file has reached its end whilst the other is happily writing well beyond 
that point.

Yet again we see that it is time to replace the lot.

> 1) Is there some reason I shouldn't be doing this in my own VM?
> 2) Should I be preparing this to submit as a fix? 


Ooh, yes please. A complete redesign would be a good start. Or a 
proposal to incorporate Flow.

tim




More information about the Squeak-dev mailing list