10 releases
new 0.0.10 | Apr 19, 2025 |
---|---|
0.0.9 | Apr 16, 2025 |
0.0.4 | Mar 25, 2025 |
#343 in Filesystem
951 downloads per month
46KB
1K
SLoC
Normalize file paths
Normalize file system path
This rust library have several functions:
- Test if path is an absolute
- Normalize path
- Join paths
- Canonicalize path
Independant clean room implementation with testcases and support for both windows and unix path styles.
You can request normalization style you want at any platform by activating features posix and windows. If you activate feature posix then posix style normalization will be always available under name normalize_posix.
Normalization rules
- Trailing slash indicating a directory is preserved. This is different from Python where tailing slash is removed.
- If path is not absolute, normalized form can go to upper directory. This is similar to Python and JavaScript.
- Drive letters are normalized to upper case
- UNC server and share are normalized to lower case
License
This is free and unencumbered software released into the public domain.
This code can be used under terms of CC0 or the Unlicense.