diff options
Diffstat (limited to 'runtime/shims/file_system.cpp')
| -rw-r--r-- | runtime/shims/file_system.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/shims/file_system.cpp b/runtime/shims/file_system.cpp index a7b64d75c..6846dc0ea 100644 --- a/runtime/shims/file_system.cpp +++ b/runtime/shims/file_system.cpp | |||
| @@ -986,8 +986,13 @@ BOOL create_directory(LPCWSTR template_name, LPCWSTR name, LPSECURITY_ATTRIBUTES | |||
| 986 | std::error_code ec; | 986 | std::error_code ec; |
| 987 | std::filesystem::create_directories(target.parent_path(), ec); | 987 | std::filesystem::create_directories(target.parent_path(), ec); |
| 988 | if (ec) return fail_bool(static_cast<DWORD>(ec.value())); | 988 | if (ec) return fail_bool(static_cast<DWORD>(ec.value())); |
| 989 | return template_name ? ::CreateDirectoryExW(template_path.c_str(), target.c_str(), security) | 989 | const BOOL created = template_name ? ::CreateDirectoryExW(template_path.c_str(), target.c_str(), security) |
| 990 | : ::CreateDirectoryW(target.c_str(), security); | 990 | : ::CreateDirectoryW(target.c_str(), security); |
| 991 | if (created) { | ||
| 992 | // Keep markers for deleted children, which must remain hidden after the folder is recreated. | ||
| 993 | std::filesystem::remove(marker(r.overlay, parts) / kRemovedDirMarker, ec); | ||
| 994 | } | ||
| 995 | return created; | ||
| 991 | } | 996 | } |
| 992 | 997 | ||
| 993 | } // namespace | 998 | } // namespace |