[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What I want in R^5RS



Well, I'm certainly not a UNIX expert but I always thought that
fcntl() could be used to lock files for exclusive access.  I guess I
was wrong.

However, it's not because current OS's dont handle this operation that
Scheme should be as simple minded.  If the Scheme implementation can't
guarantee atomicity of GRAB-FILE it can still flag an error on the
open-input-file call.  But at least I have a tool to express atomicity
if it is possible to implement.

I must admit though that if one can write

     (define (FILE-EXISTS? <filename-string>)
       (GRAB-FILE <filename-string>
	 (lambda () #t)
	 (lambda () #f)))

then chances are that people will get lazy and use this directly
anyhow (especially if no implementation actually guarantees atomicity).

Marc