SYS-CHDIR(2) SYS-CHDIR(2)
NAME
chdir - change working directory
SYNOPSIS
include "sys.m";
sys := load Sys Sys->PATH;
chdir: fn(path: string): int;
DESCRIPTION
Chdir changes the working directory of the invoking process
and its file name space group to path.
The working directory is the starting point for evaluating
file names that do not begin with / or #, as explained in
sys-intro(2).
When Inferno boots, the initial process has / for its work-
ing directory.
Applications that invoke chdir normally use the FORKNS
option of sys-pctl(2) to prevent the change from affecting
the surrounding environment.
DIAGNOSTICS
Returns 0 on success; -1 on failure.
SEE ALSO
sys-intro(2)
Page 1 Plan 9 (printed 10/27/25)