Next: , Previous: , Up: Files   [Contents][Index]


5.26.3 File Information

A number of functions exist which when given the name of a file return one of the attributes relating to that file.

Function: file-exists-p file-name

Returns true when a file file-name exists.

Function: file-regular-p file-name

Returns true when the file file-name is a ‘normal’ file. This means that it isn’t a directory, device, symbolic link or whatever.

Function: file-directory-p file-name

Returns true when the file file-name is a directory.

Function: file-symlink-p file-name

Returns true when the file file-name is a symbolic link.

Function: file-readable-p file-name

Returns true when the file file-name is readable.

Function: file-writable-p file-name

Returns true when the file file-name is writable.

Function: file-executable-p file-name

Returns true when the file file-name is executable.

Function: file-owner-p file-name

Returns true when the ownership of the file file-name is the same as that of any files written by the editor.

Function: file-gid file-name

Returns the gid of the file file-name, as integer.

Function: file-uid file-name

Returns the uid of the file file-name, as integer.

Function: file-size file-name

Returns the number of bytes stored in the file named file-name.

Function: file-nlinks file-name

Returns the number of hard links pointing to the file file-name. If file-name has only one name the number will be one.

Function: file-modes file-name

This function returns the access permissions of the file file-name. This will be an integer whose format is undefined; it differs from operating system to operating system.

Function: file-modes-as-string file-name

Returns a ten-character string describing the attibutes of the file called file-name

(file-modes-as-string ".")
    ⇒ "drwxr-sr-x"
Function: set-file-modes file-name modes

This function sets the access permissions of the file file-name to the integer modes (as returned by the file-modes function).

Function: file-modtime file-name

Returns the system time at the last modification to the file file-name, this will be in the usual timestamp format, See Timestamps.

Function: file-newer-than-file-p file-name1 file-name2

This function returns true if the file file-name1 was modified more recently than the file file-name2 was.


Next: , Previous: , Up: Files   [Contents][Index]