All Manuals > LispWorks® User Guide and Reference Manual > 38 The LISPWORKS Package

copy-file Function

Summary

Copies the contents of a file to another file.

Package

lispworks

Signature

copy-file from to &key copy-times-p copy-permissions-p

Arguments
from
A pathname designator.
to
A pathname designator.
copy-times-p
A generalized boolean.
copy-permissions-p
A generalized boolean.
Description

The function copy-file copies the contents of the file from to another file. The file from must exist.

copy-file opens from for input and to for output using if-exists :supersede (see cl:open in the Common Lisp HyperSpec) and copies the contents from from to to.

When copy-times-p is non-nil, the times of from are copied to to. On non-Windows platforms, this means the last access and last modified times and on Windows, it means the creation date, last access date and last write time (modification).

When copy-permissions-p is non-nil, the permissions of from are copied to to. On non-Windows platforms, this means the mode bits without any of the "s-bits" (S_ISUID, S_ISGID, S_ISVTX). On Windows, it means the readonly bit.

On any failure copy-file signals an error.

copy-file does not return a useful value.

See also

append-file


LispWorks® User Guide and Reference Manual - 18 Feb 2025 15:32:27