filepathutil

package
v0.64.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeStripExtension added in v0.64.5

func ChangeStripExtension(filepath, newext string) string

func CurLeafDir

func CurLeafDir() (string, error)

CurLeafDir returns the leaf dir of a nested directory.

func FilepathLeaf

func FilepathLeaf(s string) string

FilepathLeaf returns the last element of a path.

func FilterFilepaths

func FilterFilepaths(paths []string, inclExists, inclNotExists, inclFiles, inclDirs bool) []string

FilterFilepaths filters a slice of filepaths using various options.

func Trim

func Trim(file string) string

Trim trims the provided filepath using `os.PathSeparator`

func TrimExt added in v0.40.9

func TrimExt(path string) string

TrimExt removes the extension, including a trailing period.

func TrimLeft

func TrimLeft(file string) string

TrimLeft left trims the provided filepath using `os.PathSeparator`

func TrimRight

func TrimRight(file string) string

TrimRight right trims the provided filepath using `os.PathSeparator`

func UserToAbsolute

func UserToAbsolute(file string) (string, error)

UserToAbsolute converts ~ directories to absolute directories in filepaths. This is useful because ~ cannot be resolved by ioutil.ReadFile().

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL