package filepath
import "github.com/opencontainers/runtime-tools/filepath"
Package filepath implements Go's filepath package with explicit operating systems (and for some functions and explicit working directory). This allows tools built for one OS to operate on paths targeting another OS. For example, a Linux build can determine whether a path is absolute on Linux or on Windows.
Index ¶
- func Abs(os, path, cwd string) (_ string, err error)
- func Clean(os, path string) string
- func IsAbs(os, path string) bool
- func IsAncestor(os, pathA, pathB, cwd string) (_ bool, err error)
- func Join(os string, elem ...string) string
- func Separator(os string) rune
Functions ¶
func Abs ¶
Abs is a version of path/filepath's Abs with an explicit operating system and current working directory.
func Clean ¶
Clean is an explicit-OS version of path/filepath's Clean.
func IsAbs ¶
IsAbs is a version of path/filepath's IsAbs with an explicit operating system.
func IsAncestor ¶
IsAncestor returns true when pathB is an strict ancestor of pathA, and false where the paths are equal or pathB is outside of pathA. Paths that are not absolute will be made absolute with Abs.
func Join ¶
Join is an explicit-OS version of path/filepath's Join.
func Separator ¶
Separator is an explicit-OS version of path/filepath's Separator.
Source Files ¶
abs.go ancestor.go clean.go doc.go join.go separator.go
- Version
- v0.3.0
- Published
- Nov 1, 2017
- Platform
- windows/amd64
- Imports
- 4 packages
- Last checked
- 9 hours ago –
Tools for package owners.