Arclight icon indicating copy to clipboard operation
Arclight copied to clipboard

Residual directories when using Directory::create with a malformed path

Open Ed-1T opened this issue 2 years ago • 0 comments

Directory::create() (or std::filesystem::create_directories()) will create multiple directories recursively until either the end of the path is reached or an error occurs. When passing a path such as "a/b/c/<", the directories a/, a/b/ and a/b/c/ will be created, but the creation will be interrupted by the 4th path, containing an illegal character (<). This will result in residual, most of the times unwanted, directories being created despite the entire operation having failed.

Directory::create() should therefore operate as a transaction, meaning the only two possible outcomes should be 1) no directories have been created, or 2) all directories have been created.

Ed-1T avatar Jul 05 '22 23:07 Ed-1T