Skip to content

Commit bc73609

Browse files
authored
Update 586-file-chmod.markdown
1 parent 94a7ef5 commit bc73609

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

_build/reference/586-file-chmod.markdown

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,33 @@ Change permissions of a file. See also ACCESS.
77
* file - A string expression that follows OS file naming conventions.
88
* mode - Compatible with system call chmod()'s 'mode' parameter.
99

10+
Linux:
11+
12+
mode is a number best represented in octal: 0oUGO with U: User; G: Group; O: Other
13+
14+
U, G and O are each defined the following way:
15+
16+
| Value | Permission |
17+
|:-----:|:-----------:|
18+
| 0 | no |
19+
| 1 | x (execute) |
20+
| 2 | w (write) |
21+
| 3 | w + x |
22+
| 4 | r (read) |
23+
| 5 | r + x |
24+
| 6 | r + w |
25+
| 7 | r + w + x |
26+
27+
1028
```
1129
' Make myfile available to anyone (read/write)
1230
CHMOD "myfile.bas", 0o666
13-
...
31+
1432
' Make myfile available to anyone (execute/read/write)
1533
CHMOD "myfile.bas", 0o777
34+
35+
' Make myfile available to user (read/write)
36+
' All others only read
37+
CHMOD "myfile.bas", 0o644
1638
```
1739

0 commit comments

Comments
 (0)