Skip to content

When working on a Windows partition from Linux, rootcling is not able to rename an output file #9730

@eguiraud

Description

@eguiraud

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

#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
might be needed on Linux as well.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions