-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Description
- Version: 6.5.0
- Platform: Mac OS X
- Subsystem: fs
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?