fs icon indicating copy to clipboard operation
fs copied to clipboard

[Vignette] path_norm() doesn't approximate to normalizePath()

Open ColinFay opened this issue 5 years ago • 1 comments
trafficstars

In the Comparison Vignette, path_norm() is said to approximate normalizePath().

It seems that path_norm() is more the equivalent of path_abs() though:

library(fs)
normalizePath(".")
#> [1] "/private/var/folders/5z/rm2h62lj45d332kfpj28c8zm0000gn/T/RtmpdjTe5h/reprex171265ac46d6f"
path_norm(".")
#> .
path_abs(".")
#> /private/var/folders/5z/rm2h62lj45d332kfpj28c8zm0000gn/T/RtmpdjTe5h/reprex171265ac46d6f

Created on 2019-11-27 by the reprex package (v0.3.0)

ColinFay avatar Nov 27 '19 21:11 ColinFay

normalizePath() does many things, it is really more like the equivalent of path_expand() + path_abs() + path_norm().

But you are probably correct in general that of the three path_abs() is the closest to the most common uses of normalizePath().

jimhester avatar Nov 29 '19 13:11 jimhester