cwd ( -- path )
Factor documentation > Factor handbook > Input and output > Directory manipulation > Current working directory
Prev:cd ( path -- )


Vocabulary
io.files.private

Inputs and outputs
patha pathname string


Word description
Outputs the current working directory of the Factor process.

Notes
User code should use the value of the current-directory variable instead.

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

Definition
USING: io.backend ;

IN: io.files.private

HOOK: cwd io-backend ( -- path )


Methods
USING: io.files.private kernel ;

M: object cwd "." ;


USING: byte-arrays io.files.private kernel system unix unix.ffi
;

M: unix cwd
MAXPATHLEN [ <byte-array> ] keep
[ getcwd ] unix-system-call [ (io-error) ] unless* ;