FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version

current-directory

Arguments: &optional use-cache drive

Return a pathname with the directory component holding the current directory. Note that when processing pathnames (the filename passed, for example, as an argument to load), the value of *default-pathname-defaults* is typically used instead of the current directory as returned by this function. The value of *default-pathname-defaults* may not be the same as the value returned by this function. chdir modifies the current directory (what is returned by this function) but does not modify *default-pathname-defaults*. In contrast, :cd modifies both.

On UNIX, current-directory caches information about the curret directory in each call. If the use-cache optional argument is non-nil and you call current-directory from the same directory, current-directory does not compute the current working directory, it just returns the previous value (so the returned value will be eq to the previous returned value). It checks that the directory has not changed by comparing the inode of (and other relevant data about) `.' to cached information, and returning the cached pathname value if the comparisons are true. use-cache is accepted but ignored on Windows.

The drive optional argument should only be specified in Windows. Its value should be a string naming a drive (like "d:" or "d"). If given, current-directory will return the current working directory on that drive. If nil, current-directory will return the current working directory on the current drive. The current drive is the drive letter of the pathname in *default-pathname-defaults* or the last call to chdir that specified a path that contained a drive letter.

See :pwd and :dirs, which both print the current directory. See also os-interface.htm for general information on the interface between Allegro CL and the operating system.


Copyright (c) 1998-2009, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.1. This page was not revised from the 8.0 page.
Created 2009.7.29.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version