It should be "O_EXCL isn't 100% reliable on NFS if two different systems are manipulating the same file at virtually the same time". If your program is only running on one system, or if the file has already existed for a couple minutes, then O_EXCL _is_ 100% reliable.

So, according to your definition, coitus interuptus is a 100% reliable method of birth control as long as you avoid some edge cases, like a man having sex with a woman.

Regarding pregnancy, there are exactly two states: Pregnant or not. You can't be 42% pregnant. And like with pregnancy, O_EXCL on NFS (or any other networked filesystem) is either reliable and prevents access to a file by more than one process on one machine every time and under all conditions, or it is unreliable.

For Linux, the man page for open explains the situation quite well:

So, for Linux, O_EXCL is unreliable if you are running a kernel before 2.6 or use it on a non-v3 NFS. That does not mean that it is reliable with 2.6+ and NFSv3. The FreeBSD people seem to have had similar problems, especially if you mix in Solaris.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^2: How to move/copy a file without overwriting an existing file by afoken
in thread How to move/copy a file without overwriting an existing file by bart

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.