MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / setup

Function setup

test/unistd/unlink.c:28–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void setup() {
29 mkdir("working", 0777);
30 chdir("working");
31 create_file("file", "test", 0777);
32 create_file("file1", "test", 0777);
33 // create the file as readable and then use chmod
34 create_file("file-readonly", "test", 0777);
35#ifndef NO_SYMLINK
36 symlink("file1", "file1-link");
37#endif
38 mkdir("dir-empty", 0777);
39#ifndef NO_SYMLINK
40 symlink("dir-empty", "dir-empty-link");
41#endif
42 mkdir("dir-readonly", 0777);
43 create_file("dir-readonly/anotherfile", "test", 0777);
44 mkdir("dir-readonly/anotherdir", 0777);
45 chmod("dir-readonly", 0555);
46 chmod("file-readonly", 0555);
47 mkdir("dir-full", 0777);
48 create_file("dir-full/anotherfile", "test", 0777);
49}
50
51void test() {
52 int err;

Callers 1

mainFunction · 0.70

Calls 5

create_fileFunction · 0.70
mkdirFunction · 0.50
chdirFunction · 0.50
symlinkFunction · 0.50
chmodFunction · 0.50

Tested by

no test coverage detected