purescript-contrib / purescript-pathy

A type-safe abstraction for platform-independent file system paths.
Apache License 2.0
33 stars 17 forks source link

Add `printRelativeTo` #27

Closed natefaubion closed 6 years ago

natefaubion commented 7 years ago

Sometimes you have a Sandboxed path, but it needs to be printed relative to some other directory, which may involve ../. relativeTo does not handle ParentIn for security reasons, so it's not possible to print a path like this safely. Adding a printRelativeTo function would allow one to take an absolute sandboxed path, and print it relative to another arbitrary absolute path.

garyb commented 6 years ago

I think we can close this now as it's probably not as relevant as it was - sandboxing, relativeTo and printing of paths are all different now 🙂