statgetting file system information |
Miscellaneous Information |
stat()
, which fills a structure of integer fields.
The following values are available for MKS Toolkit:
dev
Disk device number.
ino
Set to 3 unless this is a root directory;
mode
Encoded description of file type and file access permissions
nlink
Always the value 1.
uid
Numeric value of owner of file.
gid
Numeric value of file's primary group owner.
rdev
Always 0
size
File size in bytes. Directories normally have size 0.
mtime
Time of file's last modification.
atime
Time of file's last access.
ctime
Time 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