20.2. File functions

20.2.1. Function PROBE-FILE
20.2.2. Function FILE-AUTHOR
20.2.3. Function DELETE-FILE
20.2.4. Function RENAME-FILE

20.2.1. Function PROBE-FILE

PROBE-FILE cannot be used to check whether a directory exists. Use functions EXT:PROBE-DIRECTORY, EXT:PROBE-PATHNAME or DIRECTORY for this.

20.2.2. Function FILE-AUTHOR

FILE-AUTHOR always returns NIL, because the operating systems CLISP is ported to do not store a file's author in the file system. Some operating systems, such as UNIX, have the notion of a file's owner, and some other Common Lisp implementations return the user name of the file owner. CLISP does not do this, because owner and author are not the same; in particular, authorship is preserved by copying, while ownership is not.

Use OS:FILE-OWNER to find the owner of the file. See also OS:FILE-PROPERTIES (Platform Dependent: Win32 platform only.).

20.2.3. Function DELETE-FILE

(DELETE-FILE pathname) deletes the pathname pathname, not its TRUENAME, and returns the absolute pathname it actually removed or NIL if pathname did not exist. When pathname points to a file which is currently open in CLISP, an ERROR is SIGNALed. To remove a directory, use EXT:DELETE-DIRECTORY instead.

20.2.4. Function RENAME-FILE

This functions accepts and extra keyword argument :IF-EXISTS. When it is :ERROR (the default), an ERROR is SIGNALed if the destination pathname names an existing file, otherwise (e.g., if it is :OVERWRITE) the destination file atomically overwritten.

When CUSTOM:*ANSI* is non-NIL, only the standard two arguments are accepted, and and ERROR is SIGNALed when the destination pathname names an existing file.

This function cannot operate on directories, use EXT:RENAME-DIRECTORY to rename a directory.


These notes document CLISP version 2.49Last modified: 2010-07-07