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 working direc‐
tory.
Applications that invoke chdir normally use the FORKNS option of sys-
pctl(2) to prevent the change from affecting the surrounding environ‐
ment.
DIAGNOSTICS
Returns 0 on success; -1 on failure.
SEE ALSOsys-intro(2)SYS-CHDIR(2)