Function | Package: excl | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## current-directory

Arguments: &optional use-cache drive

Return a pathname with the directory component holding the current directory. Note that when processing pathnames and filling in missing components (for example, when a filename is passed, as an argument to load), the system typically uses the value of `*default-pathname-defaults*` 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 current 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-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version