io

package
v0.29.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: AGPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(srcFile, dstFile string) (errToReturn error)

func CopyDirectory

func CopyDirectory(scrDir, dest string) error

CopyDirectory recursively copies a directory. From https://stackoverflow.com/questions/51779243/copy-a-folder-in-go

func CopySymLink(source, dest string) error

func CreateIfNotExists

func CreateIfNotExists(dir string, perm os.FileMode) error

func Exists

func Exists(filePath string) bool

func FileExists

func FileExists(filename string) bool

func ReadFile

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

ReadFile reads the file from path, if not found, it will print the absolute path, instead of relative path.

func TerminateOnFullDisk

func TerminateOnFullDisk(err error) error

TerminateOnFullDisk panics if the input error is (or wraps) the system "out of disk space" error. It's a no-op for any other error, or nil.

func WriteFile

func WriteFile(path string, data []byte) error

WriteFile writes a byte array to the file at the given path. This method will also create the directory and file as needed.

func WriteJSON

func WriteJSON(path string, data interface{}) error

WriteJSON marshals the given interface into JSON and writes it to the given path

func WriteText

func WriteText(path string, data []byte) error

WriteText writes a byte array to the file at the given path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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