Categorieën: Alle - functions - documentation - directories - files

door Q. Zero Lee 10 jaren geleden

293

CLISP Files

In the CLISP programming environment, file and directory handling are treated distinctly. The EXT:PROBE-PATHNAME function assesses if a given path points to an existing directory or regular file, returning specific values if found, and NIL otherwise.

CLISP Files

CLISP Files

Generic functions

...if it does not exist, returns NIL
Function EXT:PROBE-PATHNAME figures out whether teh argument refers to an existing directory or an existing regular file, and returns 4 values if the filesystem object exists.
POSIX:FILE-SIZE
FILE-WRITE-DATE
EXT:ABSOLUTE-PATHNAME
TRUENAME

Documentation

See CLISP implementation notes chapter 20

Directory functions

EXT:RENAME-DIRECTORY
EXT:DELETE-DIRECTORY
EXT:MAKE-DIRECTORY
EXT:DEFAULT-DIRECTORY
EXT:CD
EXT:DIR
DIRECTORY
EXT:PROBE-DIRECTORY

File functions

RENAME-FILE
DELETE-FILE
FILE-AUTHOR
FILE-AUTHOR always returns NIL
PROBE-FILE

Directory is not a file

You can use DIRECTORY or EXT:PROBE-PATHNAME to figure out whether a given namestring refers to a file or a directory.
CLISP provides separate directory functions, such as EXT:DELETE-DIRECTORY, EXT:RENAME-DIRECTORY et al.
CLISP has traditionally taken the view that a directory is a separate object and not a special kind of file, so whenever the standard says that a function operates on files without specifically mentioning that it also works on directories, CLISP SIGNALS an ERROR when passed a directory.