18.5 File Utilities

Some implementations of Hemlock provide extensive directory editing commands, Dired, including a single wildcard feature. An asterisk denotes a wildcard. [annotate]

copy-file  spec1 spec2 [Function]
          

This function copies spec1 to spec2. It accepts a single wildcard in the filename portion of the specification, and it accepts directories. This copies files maintaining the source's write date. [annotate]

If spec1 and spec2 are both directories, this recursively copies the files and subdirectory structure of spec1; if spec2 is in the subdirectory structure of spec1, the recursion will not descend into it. Use "/spec1/*" to copy only the files from spec1 to directory spec2. [annotate]

If spec2 is a directory, and spec1 is a file, then this copies spec1 into spec2 with the same pathname-name. [annotate]

When :update is non-nil, then the copying process only copies files if the source is newer than the destination. [annotate]

When :update and :clobber are nil, and the destination exists, the copying process stops and asks the user whether the destination should be overwritten. [annotate]

When the user supplies :directory, it is a list of pathnames, directories excluded, and spec1 is a pattern containing one wildcard. This then copies each of the pathnames whose pathname-name matches the pattern. Spec2 is either a directory or a pathname whose pathname-name contains a wildcard. [annotate]

[annotate]

rename-file  spec1 spec2 [Function]
          

This function renames spec1 to spec2. It accepts a single wildcard in the filename portion of the specification, and spec2 may be a directory with the destination specification resulting in the merging of spec2 with spec1. If :clobber is nil, and spec2 exists, then this asks the user to confirm the renaming. When renaming a directory, end the specification without the trailing slash. [annotate]

When the user supplies :directory, it is a list of pathnames, directories excluded, and spec1 is a pattern containing one wildcard. This then copies each of the pathnames whose pathname-name matches the pattern. Spec2 is either a directory or a pathname whose pathname-name contains a wildcard. [annotate]

[annotate]

delete-file  spec [Function]
          

This function deletes spec. It accepts a single wildcard in the filename portion of the specification, and it asks for confirmation on each file if :clobber is nil. If :recursive is non-nil, then spec may be a directory to recursively delete the entirety of the directory and its subdirectory structure. An empty directory may be specified without :recursive being non-nil. Specify directories with the trailing slash. [annotate]

[annotate]

find-file  name &optional directory find-all [Function]
          

This function finds the file with file-namestring name, recursively looking in directory. If find-all is non-nil, then this continues searching even after finding a first occurrence of file. Name may contain a single wildcard, which causes find-all to default to t instead of nil. [annotate]

[annotate]

make-directory  name [Function]
          

This function creates the directory with name. If it already exists, this signals an error. [annotate]

[annotate]

pathnames-from-pattern  pattern files [Function]
          

This function returns a list of pathnames from the list files whose file-namestring's match pattern. Pattern must be a non-empty string and contain only one asterisk. Files contains no directories. [annotate]

[annotate]

update-default   [Variable]
clobber-default   [Variable]
recursive-default   [Variable]
          

These are the default values for the keyword arguments above with corresponding names. These default to nil, t, and nil respectively. [annotate]

[annotate]

report-function   [Variable]
error-function   [Variable]
yesp-function   [Variable]
          

These are the function the above routines call to report progress, signal errors, and prompt for yes or no. These all take format strings and arguments. [annotate]

[annotate]

merge-relative-pathnames  pathname default-directory [Function]
          

This function merges pathname with default-directory. If pathname is not absolute, this assumes it is relative to default-directory. The result is always a directory pathname. [annotate]

[annotate]

directoryp  pathname [Function]
          

This function returns whether pathname names a directory: it has no name and no type fields. [annotate]

[annotate]