diff options
| author | tedin7 <tommasoderosa94@gmail.com> | 2026-11-23 22:24:36 +0100 |
|---|---|---|
| committer | tedin7 <tommasoderosa94@gmail.com> | 2026-11-23 22:24:36 +0100 |
| commit | 68e20ecff8f020bf95b514afb3b51023dfb1e63c (patch) | |
| tree | 45f1f49f24bb161ebca21689daaec1b7f25facb7 /runtime/shims/file_system.cpp | |
| parent | 5d74c272363f2703265d44e6aaab1a1df8ddfaf3 (diff) | |
file_system: clear marker when recreating directory
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 |