Where did you find (so quickly) that MoveFileEx is not atomic on Windows?
On the page where you gave me the link. To be more precises: I could not see that atomicity would be guaranteed. To quote the part of that page which I believe to be relevant:
1499: /* CRT is buggy on sharenames, so make sure it really isn't. 3259:win32_rename(const char *oname, const char *newname) 3314: /* if newname exists, rename it to a temporary name so that we 3348: retval = rename(szNewName, szTmpName); 3355: /* rename oname to newname */ 3356: retval = rename(szOldName, szNewName); 3360: /* ...and rename succeeded, delete temporary file/director +y */ 3365: (void)rename(szTmpName, szNewName);
So, the renaming is win32_rename is just forwarded to the rename() function, and I couldn't find anything which would guarantee us that this would be atomic.

I am willing to believe that this 'rename' will work atomically, if experienced Windows developer tell me so. It's just that I couldn't see this from the documentation.

-- 
Ronald Fischer <ynnor@mm.st>

In reply to Re^10: locking over the network (rename) by rovf
in thread locking over the network by rovf

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.