Skip to content

Conversation

wingo
Copy link
Collaborator

@wingo wingo commented Sep 16, 2025

No description provided.

@wingo wingo force-pushed the filesystem-unlink-errors branch 2 times, most recently from 89c4f76 to a6d9fc9 Compare September 22, 2025 09:57
@wingo wingo changed the title wasi:[email protected]: Add tests for unlink errors wasi:[email protected]: Add tests for unlink errors Sep 22, 2025
@wingo wingo force-pushed the filesystem-unlink-errors branch from a6d9fc9 to 344e0ee Compare September 22, 2025 11:44
@wingo wingo marked this pull request as ready for review September 22, 2025 14:00
assert_eq!(rm("/etc/passwd").await, Err(ErrorCode::NotPermitted));
assert_eq!(rm("/etc/passwd").await, Err(ErrorCode::NotPermitted));
assert_eq!(rm("z.txt").await, Err(ErrorCode::NoEntry));
assert_eq!(rm("parent/z.txt").await, Err(ErrorCode::NotPermitted));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these errors follow POSIX, and I think that if Windows diverges, there should be some adapter code. WDYT @alexcrichton ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory that seems reasonable to me yeah. Given how tricky this can be though I wouldn't be confident in saying it's the best solution until there's an implementation. For example a simple "map this code to that code" is totally fine, but if it otherwise requires a lot of other contextual information or flags-on-files or something then that's less reasonable. I'm not sure which bucket this would fall into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants