in reply to Re^2: File Read
in thread File Read

I am not attempting to lock the file... I am locking a parallel process ...

Right. What people are tying to tell you is, you should use file locking to do that. Holding state in a file without locking is inherently subject to race conditions. Instead of using the file content (0/1) to indicate a critical region in your process(es), lock a file (exclusively) and use the lock status directly. Locking is meant to do process serialization free of race conditions, if used correctly.

The file content is irrelevant, though your situation it may be useful to write the PID to the file when a process gets a lock.

Anno