From: Dave V. <va...@us...> - 2012-06-25 17:31:22
|
On Sun, Jun 24, 2012 at 3:46 PM, Charles Srstka <bas...@ch...> wrote: > You can do this > by passing O_EXLOCK to the open() function. If you want open() to fail > immediately if the file is already open instead of simply blocking until the > file is available, then pass O_NONBLOCK as well. What's the advantage of this over the flock(2) advisory locks I proposed? As far as I can tell they have the exact same behaviour on Mac OS X, but flock() is cross-platform and will work on Linux and BSD as well. -V |