Exch(1) – atomically exchanges paths between two files (2023) (man7.org) 15 points by jesprenj 2y ago ↗ HN
[–] yesco 2y ago ↗ I'm surprised this isn't in more standard libraries, are there any other atomic file operations being neglected like this?
[–] AstroJetson 2y ago ↗ I think the time it would take me to remember the command, look at the man page to see if I had it right, and then do the command, I could have done the three mv commandsmv zork mytempmv advent zorkmv mytemp advent [–] rurban 2y ago ↗ Not atomic. We are talking renameat2 () here
4 comments
[ 2.8 ms ] story [ 21.6 ms ] threadmv zork mytemp
mv advent zork
mv mytemp advent