You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide a way to call the native realpath function #8715
With #7899 landing, node.js is back to its old JS implementation of fs.realpath. I agree this move was necessary given the bugs. However, one feature of the native realpath function was that it would return the actual casing of a path as it is on disk, which is very useful to know.
Given a path of /foo/bar/some.txt and running fs.realpathSync(/foo/BAR/some.txt) would return /foo/bar/some.txt.
The only workaround to get the real casing of a path with node.js currently is to run fs.readdir on each segment of a path and building the path based on the results, because this function returns the actual casing as it exists on disk. Of course, such a method is not very optimal because it needs to do more work the longer the path is.
Would it be possible to get API in fs to resolve the path with the native realpath?
Activity
Trott commentedon May 27, 2017
@nodejs/fs
bnoordhuis commentedon Oct 5, 2017
#15776
fs: expose realpath(3) bindings