Documentation ¶
Overview ¶
Package posixpath handles posix-path (Unix style; slash separeted path).
Index ¶
- func Base(fname string) string
- func Clean(path string) string
- func Dir(fname string) string
- func IsAbs(fname string) bool
- func Join(elem ...string) string
- func Rel(basepath, targpath string) (string, error)
- func SplitElem(fname string) []string
- type FilePath
- func (FilePath) Base(path string) string
- func (FilePath) Clean(path string) string
- func (FilePath) Dir(path string) string
- func (FilePath) IsAbs(path string) bool
- func (FilePath) Join(elem ...string) string
- func (FilePath) PathSep() string
- func (FilePath) Rel(basepath, targpath string) (string, error)
- func (FilePath) SplitElem(path string) []string
- func (FilePath) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base ¶
Base returns the last element of fname. If fname is empty, or ends with path separator, Base returns ".". If fname is "/" only, Base returns "/".
func Dir ¶
Dir returns all but the last element of path, typically the path's directory. Differnt from filepath.Dir, it won't clean ".." in the result. If path is empty, Dir returns ".".
func Join ¶
Join joins any number of path elements into a single path, adding a "/" if necessary. Different from filepath.Join, it won't clean ".." in the result. All empty strings are ignored.
Types ¶
Click to show internal directories.
Click to hide internal directories.