fileutils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFileNotFound = errors.New("file not found")

Functions

func Clean

func Clean(filePath string) string

func FileExists

func FileExists(path string) bool

copied from direnv code

func FindPathTo

func FindPathTo(file string) (string, error)

func IsChildDirOrSame

func IsChildDirOrSame(child, parent string) (bool, error)

isChildDirOrSame determines if the path `child` is a child path or the same as `parent`.

func ReadFile

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

func SetFS

func SetFS(f afero.Fs)

func TextExistsInFile

func TextExistsInFile(filePath, targetText string) (bool, error)

func WriteFile

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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