We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It doesn't seem to be a way, without using java interop, of reading the target of a symlink if that target does not exist.
(def source (fs/path "source")) (def target (fs/path "target")) ;; Does not exist (fs/create-sym-link source target) ;; Wanted result, but using java interop (fs/file-name (java.nio.file.Files/readSymbolicLink source)) ; => "bar" ;; Failed attemptes (fs/file-name (fs/canonicalize source)) ; => "source" (fs/file-name (fs/canonicalize source {:nofollow-links true})) ; => "source" (fs/file-name (fs/real-path source)) ; NoSuchFileException (fs/file-name (fs/real-path source {:nofollow-links true})) ; => "source" ;; Works if file exists (fs/create-file target) (fs/file-name (fs/canonicalize source)) ; => "target" (fs/file-name (fs/real-path source)) ; => "target"
The text was updated successfully, but these errors were encountered:
In unix it's called readlink
readlink
$ readlink source target
Node calls it readlink too
> fs.readlink("source", console.log) undefined > null target
Sorry, something went wrong.
alright, fs/read-link seems like a good candidate name then
fs/read-link
Fix #132: add read-link
453ceeb
03b3b6d
No branches or pull requests
It doesn't seem to be a way, without using java interop, of reading the target of a symlink if that target does not exist.
The text was updated successfully, but these errors were encountered: