simplefs

package module
v0.0.0-...-aadc75c Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: AGPL-3.0 Imports: 9 Imported by: 2

README

simplefs

A simple Go module to handle filesystems.

  • Run tests with go test ./...

License

See LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Combine

func Combine(path1 string, path2 ...string) string

func Copy

func Copy(a, b string, opts ...copy.Options) error

func CopyAndRename

func CopyAndRename(files []string, oldPath, newPath, oldName, newName string) error

func DeleteDirectory

func DeleteDirectory(fileName string) error

func Exists

func Exists(fileName string) bool

func FromCwd

func FromCwd(path1 ...string) (string, error)

func GetDirectories

func GetDirectories(filePath string) []string

func GetDirectoryName

func GetDirectoryName(fileName string) string

func GetFileExtension

func GetFileExtension(fileName string) string

func GetFileName

func GetFileName(fileName string) string

func GetFiles

func GetFiles(filePath string) []string

func GetRelativePath

func GetRelativePath(directories ...string) string

func IsEmpty

func IsEmpty(dir string) (bool, error)

func OverwriteFile

func OverwriteFile(file *os.File) error

func ReadAllLines

func ReadAllLines(file *os.File) ([]string, error)

func ReadAllStringLines

func ReadAllStringLines(input string) ([]string, error)

func ReadFile

func ReadFile(fileName string) ([]byte, error)

func RemoveEmptyDirectories

func RemoveEmptyDirectories(root string) error

func Scan

func Scan(scanner *bufio.Scanner) ([]string, error)

func SortFileNames

func SortFileNames(files []string) []string

func TrimPath

func TrimPath(input string) string

func WriteFile

func WriteFile(fileName string, data []byte, perm fs.FileMode) error

func WriteToFile

func WriteToFile(file *os.File, entries []string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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