Closed mizlan closed 3 years ago
Is there a way to join components of a path, for example something like this?
(fs/join "/Users" "michael" "code") ;; => "/Users/michael/code"
It would be similar to Python's os.path.join for reference.
os.path.join
Since most of the functions in this library return Files, i'm not sure how this should work for a non-existent filepath.
@mizlan I think you can achieve this using the Java File.separator via interop. :) (clojure.string/join (. java.io.File separator) ["Users" "michael" "code"])
Java File.separator
(clojure.string/join (. java.io.File separator) ["Users" "michael" "code"])
This works great, thank you so much!
Is there a way to join components of a path, for example something like this?
It would be similar to Python's
os.path.join
for reference.Since most of the functions in this library return Files, i'm not sure how this should work for a non-existent filepath.