diff options
| author | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-23 17:07:57 -0500 |
|---|---|---|
| committer | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-23 17:07:57 -0500 |
| commit | dea8ce204d946c7a2e831200e1b24c8d7e4b8ab9 (patch) | |
| tree | 816b18d624e6d434c730c57a95c677b03449de0f /runtime/shims/file_system.cpp | |
| parent | 14773047f55b824aa977e610d1c2f7653b67ec5c (diff) | |
| parent | 6de6f5b2bb126a4596bd8ac813c0422435587ae6 (diff) | |
Merge PR #9567
Diffstat (limited to 'runtime/shims/file_system.cpp')
| -rw-r--r-- | runtime/shims/file_system.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/runtime/shims/file_system.cpp b/runtime/shims/file_system.cpp index 8efe705cb..2a31b664d 100644 --- a/runtime/shims/file_system.cpp +++ b/runtime/shims/file_system.cpp | |||
| @@ -986,8 +986,18 @@ 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 | if (ec) { | ||
| 995 | const DWORD error = static_cast<DWORD>(ec.value()); | ||
| 996 | ::RemoveDirectoryW(target.c_str()); | ||
| 997 | return fail_bool(error); | ||
| 998 | } | ||
| 999 | } | ||
| 1000 | return created; | ||
| 991 | } | 1001 | } |
| 992 | 1002 | ||
| 993 | } // namespace | 1003 | } // namespace |