references/sleep-functions/chdir.md

GitHub

chdir

Category: FileSystem

Source: https://sleep.dashnine.org/manual/chdir.html


Synopsis

$ chdir("directory")

changes the current working directory to the specified directory.

Parameters

"directory" - the directory to act as the current working directory

Side Effects / Notes

  • Sets the current working directory. This effects &openf, &exec, and all file system bridge operations. &fork also inherits this value.

Examples

Example:

chdir("/etc");
println(cwd());

$handle = openf("passwd");

Output:

/etc

See Also

&cwd