chmod
, as you probably know, is short for “change mode”. “mode” here refers to the st_mode
field in the inode. stat(2), the man page for the stat
, fstat
, and lstat
system calls, shows st_mode values of up to seven digits. Here’s an excerpt:
S_IFSOCK
0140000 socket
S_IFLNK
0120000 symbolic link
S_IFREG
0100000 regular file
S_IFBLK
0060000 block device
S_IFDIR
0040000 directory
S_IFCHR
0020000 character device
S_IFIFO
0010000 FIFO
OK, the first digit is always zero, to indicate that the number is octal; we can ignore that. MC seems to be ignoring the second one too. So you can see that regular files have 0 for the third (i.e., the fifth from the right) digit, and directories have 4. 2 and 6 are character device and block device, respectively; you should see these only in /dev
. Named pipes should be 1, and file system sockets should be 4. If symbolic links are displaying as 0, that’s odd; maybe somebody thought that displaying 2 would be too confusing.
Can you provide the actual text from the documentation that describes ths feature? – Ramhound – 2013-11-04T14:19:43.497