logoalt Hacker News

sega_saiyesterday at 6:41 AM1 replyview on HN

rename() is certainly the easiest to use for any sort of file-system based synchronization.


Replies

compressedgasyesterday at 8:01 PM

As long as you don't run into or want freedom from possible path races, for that you need the missing:

  frenameat2(srcdirfd, srcfd, srcname, dstdirfd, dstfd, dstname)