Raynes / fs

File system utilities for Clojure.
453 stars 119 forks source link

When I require this lib as fs,some function doesn't work at all #117

Open nesteiner opened 4 years ago

nesteiner commented 4 years ago
(require '[me.raynes.fs :as fs])
(fs/chdir "/") 
Execution error (IllegalStateException) at me.raynes.fs/chdir (fs.clj:541).
Can't change/establish root binding of: *cwd* with set
MicSokoli commented 3 years ago

Try running that inside a with-mutable-cwd block.

(require '[me.raynes.fs :as fs])

(fs/with-mutable-cwd
  (fs/chdir "/"))

According to the docs, chdir "... only works inside of with-mutable-cwd". http://raynes.github.io/fs/me.raynes.fs.html#var-chdir

http://raynes.github.io/fs/me.raynes.fs.html#var-with-mutable-cwd