-
Notifications
You must be signed in to change notification settings - Fork 1.5k
When working on a Windows partition from Linux, rootcling is not able to rename an output file #9730
Copy link
Copy link
Closed
Description
See the discussion at https://root-forum.cern.ch/t/rootcint-cannot-create-dictionary-in-a-vm/48580 .
In short, in certain situations in which the platform is Linux but the working directory belongs to a Windows file system, this call to std::rename fails because "Windows" does not allow renaming files that are currently in use.
Something like the logic that we already apply for Windows at
root/core/dictgen/src/rootcling_impl.cxx
Lines 2944 to 2955 in 7a2612d
| #ifdef WIN32 | |
| // Sometimes files cannot be renamed on Windows if they don't have | |
| // been released by the system. So just copy them and try to delete | |
| // the old one afterwards. | |
| if (ifile.is_open()) | |
| ifile.close(); | |
| if (0 != std::rename(tmpName , name)) { | |
| if (llvm::sys::fs::copy_file(tmpName , name)) { | |
| llvm::sys::fs::remove(tmpName); | |
| } | |
| } | |
| #else |
Reactions are currently unavailable