diff options
| author | kotorvr <332716892+kotorvr@users.noreply.github.com> | 2026-11-22 21:39:04 +0000 |
|---|---|---|
| committer | kotorvr <332716892+kotorvr@users.noreply.github.com> | 2026-11-22 22:05:06 +0000 |
| commit | f46e90310df7ecdcd414f4b3a1afa31e35272d5e (patch) | |
| tree | 445daa299e90f1b43e4f4e8894656c821018e0e5 /runtime/shims/file_system.cpp | |
| parent | 95f023f62b1fb5c28d88cfbc176de3d6a0c4de17 (diff) | |
file_system: a listing directly below a file is ERROR_DIRECTORY, as on the host
collect answered ERROR_PATH_NOT_FOUND for any folder that is not one in the title's
view. The host tells a missing folder (3) from a file in the folder's place (267);
view() already knows which. Reported in review by shdann, with the host table.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'runtime/shims/file_system.cpp')
| -rw-r--r-- | runtime/shims/file_system.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/shims/file_system.cpp b/runtime/shims/file_system.cpp index 947700139..75bc06eb9 100644 --- a/runtime/shims/file_system.cpp +++ b/runtime/shims/file_system.cpp | |||
| @@ -469,9 +469,11 @@ bool collect(const std::wstring& pattern, const std::vector<std::wstring>& parts | |||
| 469 | return false; | 469 | return false; |
| 470 | } | 470 | } |
| 471 | // The folder being listed has to exist in the title's view. The host would still enumerate a package folder the | 471 | // The folder being listed has to exist in the title's view. The host would still enumerate a package folder the |
| 472 | // title removed (its "." and ".."), and a folder that is missing is a missing path, not a missing file. | 472 | // title removed (its "." and ".."), and a folder that is missing is a missing path, not a missing file. A listing |
| 473 | if (!is_folder(r, dirs)) { | 473 | // below a file is a third answer on the host, ERROR_DIRECTORY. |
| 474 | error = ERROR_PATH_NOT_FOUND; | 474 | const Kind listed = view(r, dirs).kind; |
| 475 | if (listed != Kind::Directory) { | ||
| 476 | error = listed == Kind::File ? ERROR_DIRECTORY : ERROR_PATH_NOT_FOUND; | ||
| 475 | return false; | 477 | return false; |
| 476 | } | 478 | } |
| 477 | 479 | ||