mirror of https://github.com/BOINC/boinc.git
- client (unix): rename() doesn't work between filesystems.
If the user has set things up so that slots/ is a symlink to a different filesystem, things won't work when the client moves output files from the slot to project dir. Solution: if rename() fails, try system("mv ...") since mv works across filesystems
This commit is contained in:
parent
ca8afde85b
commit
c1f63276ee
|
@ -7361,3 +7361,14 @@ David 7 Dec 2012
|
|||
clientgui/
|
||||
AsyncRPC.cpp
|
||||
stdwx.h
|
||||
|
||||
David 7 Dec 2012
|
||||
- client (unix): rename() doesn't work between filesystems.
|
||||
If the user has set things up so that slots/ is a symlink
|
||||
to a different filesystem, things won't work when the client
|
||||
moves output files from the slot to project dir.
|
||||
Solution: if rename() fails, try system("mv ...")
|
||||
since mv works across filesystems
|
||||
|
||||
lib/
|
||||
filesys.cpp
|
||||
|
|
|
@ -594,7 +594,15 @@ static int boinc_rename_aux(const char* old, const char* newf) {
|
|||
if (MoveFileExA(old, newf, MOVEFILE_REPLACE_EXISTING|MOVEFILE_WRITE_THROUGH)) return 0;
|
||||
return GetLastError();
|
||||
#else
|
||||
// rename() doesn't work between filesystems.
|
||||
// So if it fails, try the "mv" command, which does work
|
||||
//
|
||||
int retval = rename(old, newf);
|
||||
if (retval) {
|
||||
char buf[MAXPATHLEN+MAXPATHLEN];
|
||||
sprintf(buf, "mv \"%s\" \"%s\"", old, newf);
|
||||
retval = system(buf);
|
||||
}
|
||||
if (retval) return ERR_RENAME;
|
||||
return 0;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue