[squeak-dev] FileDoesNotExistException on existing changes file during trunk update

tim Rowledge tim at rowledge.org
Mon Sep 1 21:25:12 UTC 2014


> 
>> But IMO the solution is easy, maintain a *single* read-only copy of the sources and changes files in SourceFilesArray (or whatever the class is called; I'm on my phone) and read source through them instead of reopen ing the damn things all the time.  
> 
> Except that Squeak files do not maintain an independent file position pointer, so reading from different positions in the same file is not thread-safe. That's why the file is opened again.
> 
It's a side effect of using the somewhat ridiculous minimal C lib interface that is so totally non-thread safe it's offensive. Yes, it's simple for basic porting but the result is decidedly suboptimal in the long run.

When making the RISC OS translation layer to allow the vm to fake out the multiple openings of files I had to cache file pointers and translate and mess around with permissions and.. yeuch. Using direct calls to 'proper' file apis that take a file reference, position, etc makes life much easier.
It's at least a decade past time we replaced the file interface. I'm not in a position to check anything in the image for the next week or two so I may be misremembering but didn't Colin P write something better recently? Yes, I suspect that making the transition would be interesting.

/tim
{insert witticism here}



More information about the Squeak-dev mailing list