Unix VM file locking?

Andreas Raab andreas.raab at gmx.de
Fri Jan 25 18:38:06 UTC 2008


Hi -

Had a fun morning this morning with some customer trouble which was 
partly caused by the Unix VM not using write locks. E.g., the Unix VM 
will happily do things like:

f1 := FileStream newFileNamed: 'foo.bar'.
f1 nextPutAll: 'Hello World'.
f2 := FileStream oldFileNamed: 'foo.bar'.
f2 nextPutAll: 'Oh, noes'.

etc. Is there an easy way to patch the Unix file code to avoid this, 
e.g., behave like Windows in such that it would disallow opening the 
same file for multiple writes?

Cheers,
   - Andreas



More information about the Squeak-dev mailing list