~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tests/unistd/access.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-09-20 22:44:35 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130920224435-apuwj4fsl3fqv1a6
Tags: 1.5.6~20130920~6010666-1
* New snapshot release
* Update the list of supported architectures to the same as libv8
  (Closes: #723129)
* emlibtool has been removed from upstream.
* Fix warning syntax-error-in-dep5-copyright
* Refresh of the patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <stdio.h>
2
2
#include <errno.h>
3
3
#include <unistd.h>
 
4
#include <emscripten.h>
4
5
 
5
6
int main() {
 
7
  EM_ASM(
 
8
    FS.writeFile('/forbidden', ''); FS.chmod('/forbidden', 0000);
 
9
    FS.writeFile('/readable',  ''); FS.chmod('/readable',  0444);
 
10
    FS.writeFile('/writeable', ''); FS.chmod('/writeable', 0222);
 
11
    FS.writeFile('/allaccess', ''); FS.chmod('/allaccess', 0777);
 
12
  );
 
13
 
6
14
  char* files[] = {"/readable", "/writeable",
7
15
                   "/allaccess", "/forbidden", "/nonexistent"};
8
16
  for (int i = 0; i < sizeof files / sizeof files[0]; i++) {