flock() question

Alex Pennace alex at pennace.org
Thu Apr 18 11:50:07 EDT 2002


On Thu, Apr 18, 2002 at 11:39:03AM -0400, David Kramer wrote:
> If I use the UNIX call flock() to lock a file, then someone tries to 
> append to that file like
> 	ps >> myfile
> or
> 	ps > myfile
> 
> Will the OS and shell respect the lock and block the write?

No. flock() is an advisory lock, intended to be used with cooperating
processes.



More information about the Discuss mailing list