files

package
v0.0.0-...-8705ae5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(source string, destination string) error

CopyDir recursively copies a directory from source to destination.

func DeleteDirIfExists

func DeleteDirIfExists(absoluteDirPath string, lowercaseHumanFriendlyName string, userHasConfirmed bool) error

func DirExists

func DirExists(absoluteDirPath string, lowercaseHumanFriendlyName string) error

DirExists checks whether a directory exists and returns an error if it doesn't.

func DirIsEmpty

func DirIsEmpty(absoluteDirPath string, lowercaseHumanFriendlyName string) (bool, error)

func FileExists

func FileExists(absoluteFilePath string, lowercaseHumanFriendlyName string) error

FileExists checks whether a file exists and returns an error if it doesn't.

func GetAbsolutePath

func GetAbsolutePath(path string) (string, error)

GetAbsolutePath returns the absolute path of the provided path.

func GetAbsolutePathOrDefault

func GetAbsolutePathOrDefault(path *string, defaultPath string) (string, error)

GetAbsolutePathOrDefault returns the absolute path of the provided path if it is not null, otherwise the absolute path of the default path.

func GetAbsolutePathOrDefaultFunc

func GetAbsolutePathOrDefaultFunc(path *string, defaultPathFunc func() (string, error)) (string, error)

GetAbsolutePathOrDefaultFunc returns the absolute path of the provided path if it is not null, otherwise the absolute path of the default path which is supplied by the default path function.

func GetUserHomeDir

func GetUserHomeDir() (string, error)

GetUserHomeDir returns the path to the home directory of the current user.

func GetWorkingDir

func GetWorkingDir() (string, error)

GetWorkingDir returns the current working directory.

func ReadBytes

func ReadBytes(filePath string) ([]byte, error)

ReadBytes returns the contents of the given file as a byte array.

func ReadString

func ReadString(filePath string) (string, error)

ReadString returns the contents of the given file as a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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