| Allegro CL version 6.2 Significant update since 6.2 release. | |||||||||
Arguments: from-pathname to-pathname &key link overwrite preserve-symbolic-links preserve-time remove-destination force
The new :osi module (see Operating System
Interface Functionality in
os-interface.htm), released after the release of
Allegro CL 6.2, has additional functionality relating to file
handling. The symbol sys:copy-file is exported from
the new excl.osi package (as well as from the
system package). Further, the copy-file function has been modified, with
two new keyword arguments: remove-destination and
force. They are described below. See OSI file handling
functionality in os-interface.htm.
Copies from-pathname to
to-pathname. If overwrite is
non-nil, to-pathname
will be overwritten if it exists.
The remove-destination and force keyword arguments were added by a patch available with sys:update-allegro (see the note at the top of this entry). If remove-destination is specified true, to-pathname is removed (if it exists) before the copy is attempted. (You might want to specify this if you have write permission for the directory but not for the file.) If force is specified true, if an error occurs opening to-pathname for overwriting, to-pathname is removed and the operation is retried. force true essentially means overwrite if you can, remove if you must (when to-pathname exists). force and overwrite are effectively ignored when remove-destination is specified true.
It is an error to specify an existing file as the value of to-pathname unless at least one of the overwrite, remove-destination, or force keyword arguments is specified true.
The link argument only has meaning on UNIX platforms (symbolic and hard links are not supported on Windows) so it is ignored on Windows. On UNIX, it can have the following values:
t: if link is t, then perform the copy by creating a hard link if
the source and destination are on the same filesystem and by creating
a symbolic link if they are on different filesystems.
:hard: if link is
:hard, then perform the copy by creating a hard
link.
nil (the default): if
link is nil, then just
copy the file.
If preserve-symbolic-links is
true, copy a symbolic link by making a symbolic
link, otherwise copy normally--link is ignored if
from-pathname is a symbolic link. Because
symbolic links are not supported on Windows, this argument has meaning
on UNIX only. preserve-symbolic-links defaults
to nil.
If preserve-time is true,
then the time on to-pathname is set to be the
same as
from-pathname. preserve-time
defaults to t.
Both from-pathname and to-pathname can be streams, in which case all the keyword arguments are ignored. This allows for copying bytes from one stream to another.
In earlier releases, copy-file accepted an element-type keyword argument to specify the element type of the streams opened to the file to be copied and the new file. That argument was not in fact useful and has been removed. A warning is signaled if it is specified.
See Filesystem manipulation functions in os-interface.htm for information on file and directory information and manipulation functions in Allegro CL.
Copyright (c) 1998-2002, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 6.2. The object described on this page has been modified in the 6.2 release; see the Release Notes.
Created 2002.2.26.
| Allegro CL version 6.2 Significant update since 6.2 release. | |||||||||