HenrikBengtsson / R.utils

🔧 R package: R.utils (this is *not* the utils package that comes with R itself)
https://henrikbengtsson.github.io/R.utils/
62 stars 14 forks source link

filePath("/..") should return "/" #142

Closed HenrikBengtsson closed 2 years ago

HenrikBengtsson commented 2 years ago

We now have:

> filePath("/..")
[1] "/.."

but this should really return "/" per, e.g. [1]. This also how:

> normalizePath("/..")
[1] "/"
> normalizePath("/../..")
[1] "/"
> normalizePath("/../../..")
[1] "/"

works.

References

HenrikBengtsson commented 2 years ago

Won't fix. filePath() should be as similar as base::file.path() as possible. One can use normalizePath() to remove the remain parts here.