file size primitive bug?
julian at beta4.com
Thu Feb 26 02:38:58 UTC 2004
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.
There are several other references to f->fileSize which I think could be
replaced with calls to the new and improved sqFileSize() (or this could
be pulled out into another helper I guess...
Does anyone see any reason why this shouldn't work this way? Is it too
slow in some case or something? I guess fstat() isn't ANSI-compliant...
how much does that matter compared to returning an incorrect value?
I guess my questions are two-fold:
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?
More information about the Squeak-dev