Thread 'mv() versus rename()'

Message boards : BOINC client : mv() versus rename()
Message board moderation

To post messages, you must log in.

AuthorMessage
Toralf Foerster

Send message
Joined: 13 Aug 09
Posts: 14
Germany
Message 46777 - Posted: 13 Dec 2012, 15:37:26 UTC

While reading the changelog of v 7.0.41 https://boinc.berkeley.edu/dev/forum_thread.php?id=6698#46649 /me wonders about this entry :
Solution: if rename() fails, try system("mv ...") since mv works across file systems.

It is my understanding that "mv" under "unix" already emulates a "rename" for the same file system and really moves data only for different file systems - or is this only true for the command "mv" ?
ID: 46777 · Report as offensive
ProfileDavid Anderson
Volunteer moderator
Project administrator
Project developer
Avatar

Send message
Joined: 10 Sep 05
Posts: 728
Message 46781 - Posted: 13 Dec 2012, 18:47:00 UTC - in response to Message 46777.  

Using system("mv") allows people to put their slot directory (where jobs are executed) on a different filesystem than the BOINC director, using a symbolic link.
-- David
ID: 46781 · Report as offensive

Message boards : BOINC client : mv() versus rename()

Copyright © 2025 University of California.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.