On 19 November 2013 14:22, Brian Craft <[email protected]> wrote:
>
> For example, I have a project with rather modest requirements, one of them
> being abstract path manipulation. In javascript:
>
> path.normalize(path.join("one", "two", "..", "three"))
> 'one/three'
>
> ruby:
>
> irb(main):003:0> Pathname.new("one") + "two" + ".." + "three"
> => #<Pathname:one/three>
>
> python:
>
> >>> os.path.normpath(os.path.join("one", "two", "..", "three"))
> 'one/three'
>
> In clojure, people recommend me.raynes.fs:
>
> => (fs/file "one" "two" ".." "three")
> #<File /inside/home/craft/cavm/one/two/../three>
>
What about:
(-> (io/file "one" "two" ".." "three") .toPath .normalizePath)
I think in this case it's more a problem with the Java API, which the fs
library wraps. Until Java 7, I don't think relative path normalisation
existed in the core Java libraries.
- James
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.