diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-05 21:50:45 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-05 21:50:45 -0700 |
commit | e9624929302ad7f10d38a8de21dd0d7f5aa1f675 (patch) | |
tree | d3ba5e61079ba13e3bc1de30713398e5f0cc1733 /tests/unistd/truncate.c | |
parent | 5adf7fcf23da86a26e7b3976872440c97494d1b4 (diff) | |
parent | ac21f0bddcdac04ff17cf60209a934dc222327d3 (diff) |
Merge pull request #1581 from inolen/rwfile
added read/writeFile helpers, updated tests to use new FS APIs
Diffstat (limited to 'tests/unistd/truncate.c')
-rw-r--r-- | tests/unistd/truncate.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unistd/truncate.c b/tests/unistd/truncate.c index 18920976..b1d9fc96 100644 --- a/tests/unistd/truncate.c +++ b/tests/unistd/truncate.c @@ -4,8 +4,15 @@ #include <fcntl.h> #include <sys/stat.h> #include <string.h> +#include <emscripten.h> int main() { + EM_ASM( + FS.writeFile('/towrite', 'abcdef'); + FS.writeFile('/toread', 'abcdef'); + FS.chmod('/toread', 0444); + ); + struct stat s; int f = open("/towrite", O_WRONLY); int f2 = open("/toread", O_RDONLY); |