JanetDocsPlaygroundI'm feeling luckyGitHub sign in

os/cd



    cfunction
    src/core/os.c on line 1548, column 1

    (os/cd path)

    Change current directory to path. Returns nil on success, errors on 
    failure.


1 exampleSign in to add an example
Loading...
# janet 1.10.1

# note that os/cd does not appear to update PWD in the shell's environment.
(os/cwd)           # => "/Users/cell/tmp"
(os/getenv "PWD")  # => "/Users/cell/tmp"
(os/cd "/tmp")     # => nil
(os/cwd)           # => "/private/tmp"  (on Apple, /tmp is actually /private/tmp)
(os/getenv "PWD")  # => "/Users/cell/tmp"
cellularmitosisPlayground