VariablePackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

*open-rename-function*

Bound to a function taking a pathname as an argument and returning a new pathname. Normally the new pathname will differ only in the filename and type slots, with both being some reasonable modification of the original filename and type. This function is run when the value of the if-exists keyword argument to open is :rename or :rename-and-delete (and the direction argument is :io or :output, so the if-exists argument is not ignored).

The function that is the initial value of this variable prepends the value of *open-rename-prefix* to the file name and appends the value of *open-rename-suffix* as the new file type (the old type, if present, becomes part of the file name). Thus, using the initial values for the three variables, a file named foo.bar will be renamed foo.bar.bak: the file name is foo.bar and the type is bak. A file named foo will be renamed foo.bak.

Note of location of the renamed file

The renamed file will be written to the directory that is the result of merging the pathname of the opened file with *default-pathname-defaults*. This means that the renamed file will typically be in the same directory as the file being opened.

In releases prior to 8.0, the renamed file was written to the directory that is the result of merging the pathname of the opened file with the current directory (as returned by excl:current-directory) rather than merging it with *default-pathname-defaults*. When the current directory was different from the directory component of *default-pathname-defaults*, the renamed file was typically located in a different directory than the file which was opened.

See Extensions to cl:make-package, cl:disassemble, cl:open in implementation.htm for information on the implementation of open.


Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version