fse

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDir

func EnsureDir(dir string) error

EnsureDir ensures a directory exists on the filesystem

func EnsureFileDir

func EnsureFileDir(fp string) error

EnsureFileDir ensures the parent directory of the file exists on the filesystem

func EnsureWriteFile

func EnsureWriteFile(filename string, data []byte, perm fs.FileMode) error

EnsureWriteFile performs os.WriteFile but ensures that all directories leading up to the file will be created

func Exists

func Exists(fp string) bool

Exists returns whether a file exists on the filesystem

func Filename

func Filename(fp string) string

Filename returns a file's name without extensions given its filepath

func FilenameWithExt

func FilenameWithExt(fp string) string

FilenameWithExt returns a file's name with its extensions given its filepath

func Filesize

func Filesize(s int64) float64

func Sanitise

func Sanitise(input string) string

Sanitise cleans up an input filename to ensure it's save for saving to the filesystem

func SortNatural

func SortNatural(a, b string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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