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
The C/C++ extension 'canonicalizes' paths, in order to compare them for equality, use them in maps, hashes, etc..
Currently: On Windows, canonicalization avoids disk access, and (therefore) does not resolve symbolic links (which are uncommon on Windows) and does not require that the target currently exists on disk. On Linux and Mac, canonicalization leverages realpath, which hits to disk, resolves symbolic links and requires that the target exists.
The differences in behaviors of the same canonicalization API on different platforms is problematic. This issue tracks making this behavior consistent across platforms and more robust.
Proposed/example API:
canonicalize_full_path - does not hit to disk, resolve symbolic links, or require that the file exists. (Leaving the Windows behavior unchanged, there is one exception: If the path is relative, it's considered to be in the current working directory. This use should be avoided, as relying on the current working directory is discouraged for multiple reasons).
canonicalize_relative_path - applies canonicalization to a relative path.
canonicalize_path_leaf - applies canonicalization to a single leaf (file or directory. No "." or ".." expected, just upper-casing on Windows).
This will require being more explicit about where symbolic links should be resolved, which should help us address open issues related to symbolic links.
The text was updated successfully, but these errors were encountered:
The C/C++ extension 'canonicalizes' paths, in order to compare them for equality, use them in maps, hashes, etc..
Currently: On Windows, canonicalization avoids disk access, and (therefore) does not resolve symbolic links (which are uncommon on Windows) and does not require that the target currently exists on disk. On Linux and Mac, canonicalization leverages
realpath
, which hits to disk, resolves symbolic links and requires that the target exists.The differences in behaviors of the same canonicalization API on different platforms is problematic. This issue tracks making this behavior consistent across platforms and more robust.
Proposed/example API:
canonicalize_full_path
- does not hit to disk, resolve symbolic links, or require that the file exists. (Leaving the Windows behavior unchanged, there is one exception: If the path is relative, it's considered to be in the current working directory. This use should be avoided, as relying on the current working directory is discouraged for multiple reasons).canonicalize_relative_path
- applies canonicalization to a relative path.canonicalize_path_leaf
- applies canonicalization to a single leaf (file or directory. No "." or ".." expected, just upper-casing on Windows).get_resolved_full_path
- Resolves symbolic links (if any), returning a canonicalized path.This will require being more explicit about where symbolic links should be resolved, which should help us address open issues related to symbolic links.
The text was updated successfully, but these errors were encountered: