Implement lfs.realpath() - #85
Conversation
For POSIX systems, the function is a straightforward wrapper around realpath() - see "man 3 realpath". On Windows, the CRT function `_fullpath` gets used instead, see https://msdn.microsoft.com/en-us/library/506720ff.aspx
|
This is a welcome addition! :)
I think lfs should strive to hide OS differences as much as possible. I remember we already have some headaches when other functions did not follow this principle, let's not add more portability corner cases. Related question: does the Windows version resolve symlinks? Also, this PR should target branch |
(Squash with 859ceb2)
I understand that concern, but a cross-platform wrapper isn't trivial - especially as
Unfortunately: No. - according to my (preliminary) testing. :( This is likely again related to the fact that the Windows function doesn't care about the actual filesystem, but simply applies certain rules to "canonicalize" the given path; as illustrated by My impression is that support for the Windows platform - and especially handling "symlinks" (NTFS reparse points) - would benefit from some major refactoring and possibly introducing some platform-specific helper functions (which probably makes it a candidate for the Regards, NiteHawk |
9cd10fe to
f77f248
Compare
The function wraps
realpath()for POSIX systems, and uses_fullpath()to achieve something similar on Windows. For now, I've deliberately chosen not to hide different / OS-specific behavior caused by the underlying implementation - e.g. Windows will not complain on non-existent paths.This pull request addresses #64.
Regards, NiteHawk