StandardFileStream>>truncate:

Tim Rowledge tim at rowledge.org
Fri Jun 3 18:50:28 UTC 2005


Chris Muller <chris at funkyobjects.org> wrote:

> Here's something to make you scratch your head.  When would the #size of
> aStandardFileStream ever change merely by closing and then opening the file?
> 
> 	myFileStream size  "3300"
> 
> 	myFileStream close; open
> 
> 	myFileStream size  "50"
> 
> Ok, don't scratch; I've already done that.  The answer is when you #truncate:
> to 50 the file, it is not reflected by #size until the file is closed and
> reopened.

This is a side effect of the fairly poor implementation of the file accessing
prims from all the way back. I'm pretty sure I've whinged about it before,
probably several times.

The sensible answer is a complete rewrite of the entire file system codebase
along with the directory and file naming cesspits. Maybe someday...


tim
--
Tim Rowledge, tim at rowledge.org, http://www.rowledge.org/tim
Useful random insult:- Mouth is in gear, brain is in neutral.



More information about the Squeak-dev mailing list