FunctionPackage: systemToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 7.0
Object described on page has changed in 7.0. Minimal update since 7.0 release.

copy-file

Arguments: from-pathname to-pathname &key link overwrite preserve-symbolic-links preserve-time remove-destination force verbose

The :osi module (see Operating System Interface Functionality in os-interface.htm) has additional functionality relating to file handling. See particularly OSI file handling functionality in that document. The symbol sys:copy-file is exported from the new excl.osi package (as well as from the system package).

Copies from-pathname to to-pathname. If overwrite is non-nil, to-pathname will be overwritten if it exists.

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:

In earlier releases, the link argument was called link-ok. link-ok is still accepted and its value is made the value of link (it is an error to supply values for both link and link-ok). Use of link-ok is deprecated.

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.

Either of both from-pathname and to-pathname can be streams (in which case irrelevant keyword arguments are ignored). This allows for copying bytes from one stream to another or a stream to or from a file.

If the verbose argument is specified true, infomation will be printed about the copying operation.

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-2006, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 7.0. The object described on this page has been modified in the 7.0 release; see the Release Notes.
Created 2005.9.20.

ToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 7.0
Object described on page has changed in 7.0. Minimal update since 7.0 release.