search for: parent_exists

Displaying 2 results from an estimated 2 matches for "parent_exists".

2012 Mar 22
1
[LLVMdev] Infinite recursion in sys::fs::create_directories()
...nt is empty. Here is how I fixed it: //------------------ error_code create_directories(const Twine &path, bool &existed) { SmallString<128> path_storage; StringRef p = path.toStringRef(path_storage); StringRef parent = path::parent_path(p); if (!parent.empty()) { bool parent_exists; if (error_code ec = exists(parent, parent_exists)) return ec; if (!parent_exists) if (error_code ec = create_directories(parent, existed)) return ec; } return create_directory(p, existed); } //------------------ Thanks, Kal
2012 Mar 21
0
[LLVMdev] Infinite recursion in sys::fs::create_directories()
...nt is empty. Here is how I fixed it: //------------------ error_code create_directories(const Twine &path, bool &existed) { SmallString<128> path_storage; StringRef p = path.toStringRef(path_storage); StringRef parent = path::parent_path(p); if (!parent.empty()) { bool parent_exists; if (error_code ec = exists(parent, parent_exists)) return ec; if (!parent_exists) if (error_code ec = create_directories(parent, existed)) return ec; } return create_directory(p, existed); } //------------------ Thanks, Kal