From b39491bf6fb747fa697e317316465dccda52b113 Mon Sep 17 00:00:00 2001
From: Marco Baringer Remove reduntant information from PATHNAME. This simply walks down 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 Returns true if Returns true if Equality is defined as: If any of these tree conditions is false for any of the components in
+ NB: This function does not convert name strings to pathnames. So
+"foo.txt" and #P"foo.txt" are different pathnames. Returns true if
-Returns a fresh list of pathnames corresponding to
-all files within the directory named by the non-wild pathname designator
- If
- When Returns true if Remove reduntant information from PATHNAME. This simply walks down 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 Returns true if CL-FAD - A portable pathname library for Common Lisp
-
canonical-pathname
- copy-file
- copy-stream
- delete-directory-and-files
- directory-exists-p
- directory-pathname-p
- file-exists-p
- list-directory
- merge-pathnames-as-directory
- merge-pathnames-as-file
- pathname-absolute-p
- pathname-as-directory
- pathname-as-file
- pathname-directory-pathname
- pathname-equal
- pathname-parent-directory
- pathname-relative-p
- pathname-root-p
- walk-directory
- path
package
+
+
list-directory
+ walk-directory
+ path
package
CL-FAD - A portable pathname library for Common Lisp
The CL-FAD dictionary
-
[Function]
canonical-pathname pathname => result
-
-
-PATHNAME
's
-pathname-directory and drops "." directories, removes :back
-and its preceding element.Querying files, directories and pathnames
-
[Function]
+
directory-exists-p pathspec => generalized-boolean
-: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.
+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
.
[Function]
@@ -155,19 +160,6 @@ CL-FAD - A portable pathname library for Common Lisp
directory designated by pathspec
does actually exist.
[Function]
-
pathname-as-directory pathspec => pathname
-
-
-
-Converts the non-wild pathname designator pathspec
to directory form, i.e. it returns a pathname which would return a true value if fed to DIRECTORY-PATHNAME-P
.
-
[Function]
-
pathname-as-file pathspec => pathname
-
-
-
-Converts the non-wild pathname designator pathspec
to file form, i.e. it returns a pathname which would return a NIL
value if fed to DIRECTORY-PATHNAME-P
.
-
[Function]
file-exists-p pathspec => generalized-boolean
@@ -178,35 +170,71 @@ CL-FAD - A portable pathname library for Common Lisp
directory is returned in directory form as if by PATHNAME-AS-DIRECTORY
.
-
[Function]
-
directory-exists-p pathspec => generalized-boolean
+
[Function]
pathname-absolute-p a => result
+
+
+
+a
is an absolute pathname. This simply
+tests if a
's directory list starts with :ABSOLUTE
[Function]
pathname-equal a b => result
+
+
+
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'.
+
+
+string=
+ nil
and keywords) which are eql
+ a
and b
then a
+and b
are different, otherwise they are the same.
-
-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
.
[Function]
-
list-directory dirname &key follow-symlinks => list
+
[Function]
pathname-relative-p a => result
+
+
-a
is a relative pathname. This simply
+tests if a
's directory starts
+with :RELATIVE
.
-
-dirname
. The pathnames of sub-directories are returned in
-directory form - see PATHNAME-AS-DIRECTORY
.
-follow-symlinks
is true (which is the
- default), 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.
-follow-symlinks
is NIL
, it should return the actual directory
- contents, which might include symlinks. (This is currently implemented only on SBCL and CCL.)
-
[Function]
pathname-root-p a => result
+
+
+
+pathname
is the root
+directory (in other words, a directory which is its own parent).Manipulating pathnames
+
+
[Function]
canonical-pathname pathname => result
+
+
PATHNAME
's
+pathname-directory and drops "." directories, removes :back
+and its preceding element.: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.
[Function]
merge-pathnames-as-directory &rest pathnames => result
@@ -266,10 +294,17 @@ CL-FAD - A portable pathname library for Common Lisp
[Function]
pathname-absolute-p a => result
-
-
a
is an absolute pathname. This simply
-tests if a
's directory list starts with :ABSOLUTE
[Function]
+
pathname-as-directory pathspec => pathname
+
+
+
+Converts the non-wild pathname designator pathspec
to directory form, i.e. it returns a pathname which would return a true value if fed to DIRECTORY-PATHNAME-P
.
+
[Function]
+
pathname-as-file pathspec => pathname
+
+
+Converts the non-wild pathname designator pathspec
to file form, i.e. it returns a pathname which would return a NIL
value if fed to DIRECTORY-PATHNAME-P
.
[Function]
pathname-directory-pathname pathname => result
@@ -282,33 +317,6 @@ CL-FAD - A portable pathname library for Common Lisp
per pathname-equal) to it.
[Function]
pathname-equal a b => result
-
- --Returns true if
- -a
andb
-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 botha
-andb
to probe-file one can make this function test for -file 'sameness'.Equality is defined as:
- --
- -- strings that are
string=
-- symbols (including
nil
and keywords) which areeql
-- 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
andb
thena
-andb
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.
- -
[Function]
pathname-parent-directory pathname => result
@@ -324,17 +332,27 @@-CL-FAD - A portable pathname library for Common Lisp
[Function]
pathname-relative-p a => result
-
-+Returns true if
-a
is a relative pathname. This simply -tests ifa
's directory starts -with:RELATIVE
.
[Function]
pathname-root-p a => result
-
--Returns true if
+pathname
is the root -directory (in other words, a directory which is its own parent).
[Function] +
list-directory dirname &key follow-symlinks => list + +
++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 - seePATHNAME-AS-DIRECTORY
. ++ If
+follow-symlinks
is true (which is the + default), 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
isNIL
, it should return the actual directory + contents, which might include symlinks. (This is currently implemented only on SBCL and CCL.) +
[Function] @@ -367,23 +385,7 @@CL-FAD - A portable pathname library for Common Lisp
[Function]
-
delete-directory-and-files dirname&key if-does-not-exist => |
-
-
+
--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
(the default) means that an error will be signaled if the directory -dirname
does not exist. -- Warning: this function might remove files from outside the - directory, if the directory that you are deleting contains links to - external files. This is currently fixed for SBCL and CCL. -
-
[Function]
copy-file from to &key overwrite => |
@@ -406,6 +408,25 @@
[Function]
+
delete-directory-and-files dirname&key if-does-not-exist => |
+
+
+ +
++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
(the default) means that an error will be signaled if the directory +dirname
does not exist. ++ Warning: this function might remove files from outside the + directory, if the directory that you are deleting contains links to + external files. This is currently fixed for SBCL and CCL. +
+
PATH
package
[Package]
(defpackage path)