with-directory ( path quot -- )
Factor handbook > Input and output > Directory manipulation > Current working directory

Prev:set-current-directory ( path -- )
Next:absolute-path ( path -- path' )


Vocabulary
io.directories

Inputs and outputs
patha pathname string
quota quotation


Word description
Calls the quotation in a new dynamic scope with the current-directory variable rebound.

If path is relative, it is first resolved relative to the current directory. If path is absolute, it becomes the new current directory.

See also
cd, cwd, current-directory, set-current-directory

Definition