This is an archive of the discontinued LLVM Phabricator instance.

Use llvm::sys::fs::create_directories to create new directory on Windows
ClosedPublic

Authored by ovyalov on Apr 10 2015, 9:21 AM.

Details

Reviewers
zturner
Summary

Use llvm::sys::fs::create_directories to create new directory on Windows - to allow recursive creation of non-existing folders.

Diff Detail

Event Timeline

ovyalov updated this revision to Diff 23607.Apr 10 2015, 9:21 AM
ovyalov retitled this revision from to Use SHCreateDirectory to create new directory on Windows.
ovyalov updated this object.
ovyalov edited the test plan for this revision. (Show Details)
ovyalov added a reviewer: zturner.
ovyalov added a subscriber: Unknown Object (MLST).
zturner edited edge metadata.Apr 10 2015, 9:29 AM

I kind of don't like the shell functions and would prefer to avoid them wherever possible. They're very heavyweight, can fail for mysterious reasons, and are all intertwined with displaying UI and all other kinds of unnecessary stuff. Plus, MSDN says this function was dropped in Vista (There's SHCreateDirectoryEx apparently, but even that function has a deprecation warning on MSDN).

LLVM has llvm::sys::fs::create_directories() in llvm/Support/FileSystem.h. Can you try that and see if it satisfies your needs?

ovyalov updated this revision to Diff 23608.Apr 10 2015, 9:54 AM
ovyalov edited edge metadata.

Switched to use lvm::sys::fs::create_directories instead of SHCreateDirectory.
Please take another look.

ovyalov retitled this revision from Use SHCreateDirectory to create new directory on Windows to Use llvm::sys::fs::create_directories to create new directory on Windows.Apr 10 2015, 10:03 AM
ovyalov updated this object.
zturner accepted this revision.Oct 15 2015, 1:45 PM
zturner edited edge metadata.
This revision is now accepted and ready to land.Oct 15 2015, 1:45 PM
ovyalov closed this revision.Oct 15 2015, 3:21 PM

Submitted as r234610