Portable current-working-directory lookups and changes
This library aims to be a portable (cross-implementation and cross-platform) implementation of three things:
- show the current-working-directory
- change the current-working-directory
- temporarily change the current working directory for a few operations, then change back
Once you've got it loaded you have access to three primitives:
- Takes no arguments.
- Returns the absolute
pathnamerepresenting the current-working directory in a platform-independand way.
- Takes one argument; the directory to change to (this can be given in relative, or absolute
- Returns the new current-working-directory
- Errors if it can't
cdinto the target for some reason (for example if it doesn't exist, or if you have insufficient permissions)
- Takes a directory (in the same formats as
cl-cwd:cwd), and a body argument
- Runs the body forms in the context of the specified directory, then returns to the original directory.
unwind-protectis present, so it'll return in case of errors too.