| 26 | } |
| 27 | |
| 28 | void 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 | |
| 51 | void test() { |
| 52 | int err; |