This section describes the functions for getting detailed information about a file, other than its contents. This information includes the mode bits that control access permission, the owner and group numbers, the number of names, the inode number, the size, and the times of access and modification.
The highest value returnable is 4095 (7777 octal), meaning that everyone has read, write, and execute permission, that the SUID bit is set for both others and group, and that the sticky bit is set.
(file-modes "~/junk/diffs")
=> 492 ; Decimal integer.
(format "%o" 492)
=> "754" ; Convert to octal.
(set-file-modes "~/junk/diffs" 438)
=> nil
(format "%o" 438)
=> "666" ; Convert to octal.
% ls -l diffs
-rw-rw-rw- 1 lewis 0 3063 Oct 30 16:00 diffs
nil. Note that symbolic links have no effect on this
function, because they are not considered to be names of the files they
link to.
% ls -l foo*
-rw-rw-rw- 2 rms 4 Aug 19 01:27 foo
-rw-rw-rw- 2 rms 4 Aug 19 01:27 foo1
(file-nlinks "foo")
=> 2
(file-nlinks "doesnt-exist")
=> nil
nil.
The elements of the list, in order, are:
t for a directory, a string for a symbolic link (the name
linked to), or nil for a text file.
add-name-to-file function
(see section Changing File Names and Attributes).
current-time; see section Time of Day.)
t if the file's GID would change if file were
deleted and recreated; nil otherwise.
(high . low), where low
holds the low 16 bits.
For example, here are the file attributes for `files.texi':
(file-attributes "files.texi")
=> (nil 1 2235 75
(8489 20284)
(8489 20284)
(8489 20285)
14906 "-rw-rw-rw-"
nil 129500 -32252)
and here is how the result is interpreted:
nil
1
2235
75
(8489 20284)
(8489 20284)
(8489 20285)
14906
"-rw-rw-rw-"
nil
129500
-32252
Go to the first, previous, next, last section, table of contents.