https://github.com/mandelsoft/filepath
Go package for handling pathnames fixing severe problems of the original go package
https://github.com/mandelsoft/filepath
Last synced: 11 months ago
JSON representation
Go package for handling pathnames fixing severe problems of the original go package
- Host: GitHub
- URL: https://github.com/mandelsoft/filepath
- Owner: mandelsoft
- License: bsd-3-clause
- Created: 2017-12-24T08:34:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-23T09:06:53.000Z (over 2 years ago)
- Last Synced: 2025-04-05T22:02:11.618Z (about 1 year ago)
- Language: Go
- Size: 789 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Package `filepath` implements utility routines for manipulating filename paths
in a way compatible with the target operating system-defined file paths.
It is a modification of the original GO package `path/filepath` solving
severe errors in handling symbolic links.
The original package defines a function `Clean` that formally normalizes
a file path by eliminating `..` and `.` entries. This is done WITHOUT
observing the actual file system. Although this is no problem for
the function itself, because it is designed to do so, it becomes a severe
problem for the whole package, because nearly all functions internally use
`Clean` to clean the path. As a consequence even functions like `Join` deliver
corrupted invalid results for valid inputs if the path incorporates
symbolic links to directories. Especially `EvalSymlinks` cannot be used
to evaluate paths to existing files, because `Clean` is internally used to
normalize content of symbolic links.
This package provides a set of functions that do not hamper the meaning
of path names keeping the rest of the original specification as far as
possible. Additionally some new functions (like `Canonical`) or alternate
versions of existing functions (like `Split2`) are provided
that offer a more useful specification than the original one.
### NOTE:
So far, the windows operating system is NOT tested.