-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add createFile to JS API for wasmfs (#23667) #23668
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
82c5e54
587c135
24edb2f
41ce74a
5edbd0b
893d559
cc7f2af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * Copyright 2023 The Emscripten Authors. All rights reserved. | ||
| * Copyright 2025 The Emscripten Authors. All rights reserved. | ||
| * Emscripten is available under two separate licenses, the MIT license and the | ||
| * University of Illinois/NCSA Open Source License. Both these licenses can be | ||
| * found in the LICENSE file. | ||
|
|
@@ -469,6 +469,17 @@ void cleanup() { | |
| remove("closetestfile"); | ||
| } | ||
|
|
||
| #if WASMFS | ||
|
||
| void test_fs_createfile_js() { | ||
| EM_ASM( | ||
| var backend = MEMFS.createBackend({}); | ||
| var file = FS.createFile("/test.txt", 0o777, backend); | ||
| assert(file > 0); | ||
| FS.close(file); | ||
| ); | ||
| } | ||
| #endif | ||
|
|
||
| int main() { | ||
| test_fs_open(); | ||
| test_fs_createPath(); | ||
|
|
@@ -483,6 +494,7 @@ int main() { | |
| #if WASMFS | ||
| // TODO: Fix legacy API FS.mmap bug involving emscripten_builtin_memalign | ||
| test_fs_mmap(); | ||
| test_fs_createfile_js(); | ||
| #endif | ||
| test_fs_mkdirTree(); | ||
| test_fs_utime(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't update out copyright dates when we modify files