statgetting file system information |
Miscellaneous Information |
stat(), which fills a structure of integer fields.
The following values are available for MKS Toolkit:
devDisk device number.
inoSet to 3 unless this is a root directory;
modeEncoded description of file type and file access permissions
nlinkAlways the value 1.
uidNumeric value of owner of file.
gidNumeric value of file's primary group owner.
rdevAlways 0
sizeFile size in bytes. Directories normally have size 0.
mtimeTime of file's last modification.
atimeTime of file's last access.
ctimeTime of file's creation.
provides permission to read, write, or execute a file by its owner, allows others in the same group to write the file, and prevents anyone else from accessing this file. If this same permission was applied to a directory, then the owner could read, search, and add or delete files under the directory, and users in the same group could add or delete files, while anyone else could not do anything with this directory. Regarding modes, the0720 (octal)
ls and
chmod commands try to mirror the
same capabilities as are available under UNIX systems. You can specify modes
with the octal notation shown earlier, or by concatenating the indicated mode
specifiers. For example, the octal mode 0720 could also be given as:
in the output of the-rwx-w----
ls command, and
specified as
for theu=rwx,g=w
chmod command.
| Bit | Value | Specifier | File | Directory |
0 |
1 |
x |
executable | can search directory |
1 |
2 |
w |
write access | can modify (delete/add files) |
2 |
4 |
r |
read access | read access |
Table 1: Mode Permission Bits