This is the cl-fad Reference Manual, version 0.7.6, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:52:20 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-fad
Portable pathname library
BSD-2-Clause
0.7.6
sb-posix
(system).
bordeaux-threads
(system).
alexandria
(system).
packages.lisp
(file).
fad.lisp
(file).
path.lisp
(file).
temporary-files.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-fad/fad.lisp
packages.lisp
(file).
cl-fad
(system).
canonical-pathname
(function).
copy-file
(function).
copy-stream
(function).
delete-directory-and-files
(function).
directory-exists-p
(function).
directory-pathname-p
(function).
file-exists-p
(function).
list-directory
(function).
merge-pathnames-as-directory
(function).
merge-pathnames-as-file
(function).
pathname-absolute-p
(function).
pathname-as-directory
(function).
pathname-as-file
(function).
pathname-directory-pathname
(function).
pathname-equal
(function).
pathname-parent-directory
(function).
pathname-relative-p
(function).
pathname-root-p
(function).
walk-directory
(function).
*hyperdoc-base-uri*
(special variable).
*stream-buffer-size*
(special variable).
component-present-p
(function).
directory-wildcard
(function).
hyperdoc-lookup
(function).
pathname-device-equal
(function).
pathname-directory-equal
(function).
pathname-host-equal
(function).
pathname-name-equal
(function).
pathname-type-equal
(function).
pathname-version-equal
(function).
with-component-testers
(macro).
cl-fad/path.lisp
fad.lisp
(file).
cl-fad
(system).
-d
(compiler macro).
-d
(function).
-e
(compiler macro).
-e
(function).
=
(compiler macro).
=
(function).
absolute-p
(compiler macro).
absolute-p
(function).
basename
(function).
catdir
(compiler macro).
catdir
(function).
catfile
(compiler macro).
catfile
(function).
dirname
(compiler macro).
dirname
(function).
relative-p
(compiler macro).
relative-p
(function).
rm-r
(compiler macro).
rm-r
(function).
root-p
(compiler macro).
root-p
(function).
defalias
(macro).
cl-fad/temporary-files.lisp
cl-fad
(system).
*default-template*
(special variable).
cannot-create-temporary-file
(condition).
invalid-temporary-pathname-template
(condition).
open-temporary
(function).
with-open-temporary-file
(macro).
with-output-to-temporary-file
(macro).
*create-file-name-lock*
(special variable).
*max-tries*
(special variable).
*name-random-state*
(special variable).
directory-from-environment
(function).
generate-random-pathname
(function).
generate-random-string
(function).
get-default-temporary-directory
(function).
getenv
(function).
with-file-name-lock-held
(macro).
Packages are listed by definition order.
path
Rexporting certain functions from the cl-fad package with shorter names.
This package provides no functionality, it serves only to make file system intensive code easier to read (for unix people at least).
-d
(compiler macro).
-d
(function).
-e
(compiler macro).
-e
(function).
=
(compiler macro).
=
(function).
absolute-p
(compiler macro).
absolute-p
(function).
basename
(function).
catdir
(compiler macro).
catdir
(function).
catfile
(compiler macro).
catfile
(function).
dirname
(compiler macro).
dirname
(function).
relative-p
(compiler macro).
relative-p
(function).
rm-r
(compiler macro).
rm-r
(function).
root-p
(compiler macro).
root-p
(function).
cl-fad
fad
common-lisp
.
*default-template*
(special variable).
cannot-create-temporary-file
(condition).
canonical-pathname
(function).
copy-file
(function).
copy-stream
(function).
delete-directory-and-files
(function).
directory-exists-p
(function).
directory-pathname-p
(function).
file-exists-p
(function).
invalid-temporary-pathname-template
(condition).
list-directory
(function).
merge-pathnames-as-directory
(function).
merge-pathnames-as-file
(function).
open-temporary
(function).
pathname-absolute-p
(function).
pathname-as-directory
(function).
pathname-as-file
(function).
pathname-directory-pathname
(function).
pathname-equal
(function).
pathname-parent-directory
(function).
pathname-relative-p
(function).
pathname-root-p
(function).
walk-directory
(function).
with-open-temporary-file
(macro).
with-output-to-temporary-file
(macro).
*create-file-name-lock*
(special variable).
*hyperdoc-base-uri*
(special variable).
*max-tries*
(special variable).
*name-random-state*
(special variable).
*stream-buffer-size*
(special variable).
component-present-p
(function).
defalias
(macro).
directory-from-environment
(function).
directory-wildcard
(function).
generate-random-pathname
(function).
generate-random-string
(function).
get-default-temporary-directory
(function).
getenv
(function).
hyperdoc-lookup
(function).
pathname-device-equal
(function).
pathname-directory-equal
(function).
pathname-host-equal
(function).
pathname-name-equal
(function).
pathname-type-equal
(function).
pathname-version-equal
(function).
with-component-testers
(macro).
with-file-name-lock-held
(macro).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Create a temporary file using OPEN-TEMPORARY with ARGS and run BODY with STREAM bound to the temporary file stream. Returns the values returned by BODY. By default, the file is deleted when BODY is exited. If a true value is passed in KEEP, the file is not deleted when the body is exited. See OPEN-TEMPORARY for more permitted options.
Create a temporary file using OPEN-TEMPORARY with ARGS and run BODY with STREAM bound to the temporary file stream. Returns the pathname of the file that has been created. See OPEN-TEMPORARY for permitted options.
Remove redundant information from PATHNAME.
This simply walks down PATHNAME’s pathname-directory and drops "."
directories, removes :back and its preceding element.
NB: This function does not access the filesystem, it only looks at the
values in the pathname and works on their known (or assumed)
meanings.
NB: Since this function does not access the filesystem it will only
remove :BACK elements from the path (not :UP elements). Since some
lisps, ccl/sbcl/clisp convert ".." in pathnames to :UP, and
not :BACK, the actual utility of the function is limited.
Copies the file designated by the non-wild pathname designator FROM to the file designated by the non-wild pathname designator TO. If OVERWRITE is true overwrites the file designated by TO if it exists.
Copies into TO (a stream) from FROM (also a stream) until the end of FROM is reached, in blocks of *stream-buffer-size*. The streams should have the same element type. If CHECKP is true, the streams are checked for compatibility of their types.
Recursively deletes all files and directories within the directory
designated by the non-wild pathname designator DIRNAME including
DIRNAME itself. IF-DOES-NOT-EXIST must be one of :ERROR or :IGNORE
where :ERROR means that an error will be signaled if the directory
DIRNAME does not exist.
NOTE: this function is dangerous if the directory that you are removing contains symlinks to files outside of it - the target files might be removed instead! This is currently fixed for SBCL and CCL.
Checks whether the file named by the pathname designator PATHSPEC exists and if it is a directory. Returns its truename if this is the case, NIL otherwise. The truename is returned in directory form as if by PATHNAME-AS-DIRECTORY.
Returns NIL if PATHSPEC (a pathname designator) does not designate a directory, PATHSPEC otherwise. It is irrelevant whether file or directory designated by PATHSPEC does actually exist.
Checks whether the file named by the pathname designator PATHSPEC exists and returns its truename if this is the case, NIL otherwise. The truename is returned in ‘canonical’ form, i.e. the truename of a directory is returned as if by PATHNAME-AS-DIRECTORY.
Returns a fresh list of pathnames corresponding to all files within
the directory named by the non-wild pathname designator DIRNAME.
The pathnames of sub-directories are returned in directory form -
see PATHNAME-AS-DIRECTORY.
If FOLLOW-SYMLINKS is true, then the returned list contains
truenames (symlinks will be resolved) which essentially means that it
might also return files from *outside* the directory. This works on
all platforms.
When FOLLOW-SYMLINKS is NIL, it should return the actual directory contents, which might include symlinks. Currently this works on SBCL and CCL.
Given a list of (probably relative) pathnames, this returns a single
directory pathname containing the logical concatenation of them all.
The returned value is the current directory if one were to cd into
each of PATHNAMES in order. For this reason an absolute pathname will,
effectively, cancel the affect of any previous relative pathnames.
The returned value’s defaults are taken from the first element of
PATHNAMES (host, version and device).
NB: Since this function only looks at directory names the name and
type of the elements of PATHNAMES are ignored. Make sure to properly
use either trailing #\/s, or pathname-as-directory, to get the
expected results.
Examples:
(merge-pathnames-as-directory #P"foo/" #P"bar/") == #P"foo/bar/" (merge-pathnames-as-directory #P"foo/" #P"./bar/") == #P"foo/./bar/" (merge-pathnames-as-directory #P"foo/" #P"/bar/") == #P"/bar/" (merge-pathnames-as-directory #P"foo/" #P"/bar/" #P"quux/file.txt") == #P"/bar/quux/"
Given a list of, probably relative, pathnames returns a single
filename pathname containing the logical concatenation of them all.
The returned value’s defaults are taken from the first element of
PATHNAMES (host, version and device). The returned values’s name, type
and version are taken from the last element of PATHNAMES. The
intervening elements are used only for their pathname-directory
values.
Examples:
(merge-pathnames-as-file #P"foo/" #P"bar.txt") == #P"foo/bar.txt" (merge-pathnames-as-file #P"foo/" #P"./bar.txt") == #P"foo/./bar.txt" (merge-pathnames-as-file #P"foo/" #P"/bar/README") == #P"/bar/README" (merge-pathnames-as-file #P"/foo/" #P"/bar/" #P"quux/file.txt") == #P"/bar/quux/file.txt"
Create a file with a randomly generated name and return the opened
stream. The resulting pathname is generated from TEMPLATE, which
is a string representing a pathname template. A percent sign (%)
in that string is replaced by a randomly generated string to make
the filename unique. The default for TEMPLATE places temporary
files in the TEMPORARY-FILES logical pathname host, which is
automatically set up in a system specific manner. The file name
generated from TEMPLATE is merged with *DEFAULT-PATHNAME-DEFAULTS*,
so random pathnames relative to that directory can be generated by
not specifying a directory in TEMPLATE.
GENERATE-RANDOM-STRING can be passed to override the default
function that generates the random name component. It should
return a random string consisting of characters that are permitted
in a pathname (logical or physical, depending on TEMPLATE).
The name of the temporary file can be accessed calling the PATHNAME
function on STREAM. For convenience, the temporary file is opened
on the physical pathname, i.e. if the TEMPLATE designate a logical
pathname the translation to a physical pathname is performed before
opening the stream.
In order to create a unique file name, OPEN-TEMPORARY may loop internally up to MAX-TRIES times before giving up and signalling a CANNOT-CREATE-TEMPORARY-FILE condition.
Returns true if A is an absolute pathname.
This simply tests if A’s directory list starts with :ABSOLUTE
Converts the non-wild pathname designator PATHSPEC to directory form.
Converts the non-wild pathname designator PATHSPEC to file form.
Returns a complete pathname representing the directory of PATHNAME. If PATHNAME is already a directory pathname (name NIL, type NIL) returns a pathname equal (as per pathname=) to it.
Returns T if A and B represent the same pathname. This function
does not access the filesystem, it only looks at the components of the
two pathnames to test if they are the same (though by
passing both A and B to probe-file one can make this function test for file ’sameness’.
Equality is defined as:
- strings that are string equal
- symbol (including nil) or keywords which are eql
- lists of the same length with equal (as per these rules) elements.
if any of these tree conditions is false for any of the components in
A and B then A and B are different, otherwise they are the same.
NB: This function does not convert name strings to pathnames. So
"foo.txt" and #P"foo.txt" are different pathnames.
Returns a pathname which would, by name at least, contain PATHNAME
as one of its direct children. Symlinks can make the parent/child
relationship a like opaque, but generally speaking the value returned
by this function is a directory name which contains PATHNAME.
The root directory, #P"/", is its own parent. The parent directory of a filename is the parent of the filename’s dirname.
Returns true if A is a relative pathname.
This simply tests if A’s directory starts with :RELATIVE.
Recursively applies the function FN to all files within the
directory named by the non-wild pathname designator DIRNAME and all of
its sub-directories. FN will only be applied to files for which the
function TEST returns a true value. If DIRECTORIES is not NIL, FN and
TEST are applied to directories as well. If DIRECTORIES
is :DEPTH-FIRST, FN will be applied to the directory’s contents first.
If DIRECTORIES is :BREADTH-FIRST and TEST returns NIL, the directory’s
content will be skipped. IF-DOES-NOT-EXIST must be one of :ERROR
or :IGNORE where :ERROR means that an error will be signaled if the
directory DIRNAME does not exist. If FOLLOW-SYMLINKS is T, then your
callback will receive truenames. Otherwise you should get the actual
directory contents, which might include symlinks. This might not be
supported on all platforms. See LIST-DIRECTORY.
error
.
common-lisp
.
:string
Helper function for DIRECTORY-PATHNAME-P which checks whether VALUE is neither NIL nor the keyword :UNSPECIFIC.
Returns a wild pathname designator that designates all files within the directory named by the non-wild pathname designator DIRNAME.
Query the libc runtime environment. See getenv(3).
Jump to: | -
=
A B C D F G H L M O P R W |
---|
Jump to: | -
=
A B C D F G H L M O P R W |
---|
Jump to: | *
M S T |
---|
Jump to: | *
M S T |
---|
Jump to: | C F I P S T |
---|
Jump to: | C F I P S T |
---|