Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing mkdir -p #124

Closed
willemneal opened this issue Apr 26, 2019 · 3 comments
Closed

Implementing mkdir -p #124

willemneal opened this issue Apr 26, 2019 · 3 comments
Labels
wasi:api Issues pertaining to the WASI API, not necessarily specific to Wasmtime.

Comments

@willemneal
Copy link

I'm implementing Wasi for AssemblyScript and currently I'm confused with the API for creating a directory. Is it safe to assume that by default trying to create a directory, whose parent(s) don't exist that it would fail?

Also what is the best way to determine if a file or directory exists?

@sunfishcode
Copy link
Member

Yes, __wasi_path_create_directory only creates one directory, similar to POSIX mkdir, and fails if the parent doesn't exist.

The typical way to test whether a file or directory exists is to just try to do whatever you would want to do, and handle errors in case it doesn't work. For mkdir -p, this means that you can just call __wasi_path_create_directory once for each path component. At each component, if you get __WASI_EEXIST, then it already exists and you can move the the next component. If it succeeds, then you just created it and you can move to the next component.

@sunfishcode sunfishcode added the wasi:api Issues pertaining to the WASI API, not necessarily specific to Wasmtime. label Apr 26, 2019
@willemneal
Copy link
Author

Thanks! That makes a lot of sense.

@tschneidereit
Copy link
Member

Closing this based on @sunfishcode's comment.

kubkon pushed a commit that referenced this issue Nov 7, 2019
* Implement clock_time_get on Windows.

Also update misc_testsuite to include latest clock_time_get test
changes.

* Try to somehow implement clock_res_get on Windows.

* Fix 55ms

* Cache the perf counter resolution

* Fix integration tests
pchickey added a commit to pchickey/wasmtime that referenced this issue May 16, 2023
…e-outgoing-http-command-world

feat: create command-extended world
mooori pushed a commit to mooori/wasmtime that referenced this issue Dec 20, 2023
frank-emrich pushed a commit to frank-emrich/wasmtime that referenced this issue Mar 10, 2024
avanhatt pushed a commit to wellesley-prog-sys/wasmtime that referenced this issue Oct 9, 2024
Specify and verify `ineg` on AArch64.

Updates avanhatt#34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi:api Issues pertaining to the WASI API, not necessarily specific to Wasmtime.
Projects
None yet
Development

No branches or pull requests

3 participants