utl

package
v1.56.55 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToFile

func AppendToFile(name string, content string) error

AppendToFile appends content to a file

func Cleanup

func Cleanup(folders []string)

Cleanup removes leftover folders

func CopyFile

func CopyFile(src string, dest string) error

CopyFile copy a file

func CopyFolder

func CopyFolder(source string, dest string) (err error)

CopyFolder copy a folder

func CreateFile

func CreateFile(path string, content string) error

CreateFile creates / overwrites a file with content

func CreateFolder

func CreateFolder(path ...string) string

CreateFolder to create a folder and get its path

func DownloadFile

func DownloadFile(filepath string, url string) error

DownloadFile will download a url to a local file

func Exists

func Exists(name string) bool

Exists reports whether the named file or directory exists

func FileContains

func FileContains(name string, text string) (bool, error)

FileContains reports if a file contains text

func FindElectronAppFolder

func FindElectronAppFolder(prefix string, source string) (string, error)

FindElectronAppFolder returns the app electron folder

func FormatUnixPath

func FormatUnixPath(path string) string

FormatUnixPath to format a path for unix

func FormatWindowsPath

func FormatWindowsPath(path string) string

FormatWindowsPath to format a path for windows

func IsDirEmpty

func IsDirEmpty(name string) (bool, error)

IsDirEmpty determines if directory is empty

func PathJoin

func PathJoin(elem ...string) string

PathJoin to join paths

func RemoveContents

func RemoveContents(dir string) error

RemoveContents remove contents of a specified directory

func Replace

func Replace(filename string, old string, new string) error

Replace text in file

func ReplaceByPrefix

func ReplaceByPrefix(filename string, prefix string, replace string) error

ReplaceByPrefix replaces line in file starting with a specific prefix

func RoamingPath

func RoamingPath() string

RoamingPath returns the user roaming path through APPDATA env var

func SetFileAttributes

func SetFileAttributes(path string, attrs uint32) error

SetFileAttributes set attributes to a file

func StartMenuPath

func StartMenuPath() string

StartMenuPath returns the user start menu path

func WriteToFile

func WriteToFile(name string, content string) error

WriteToFile writes content to a file

Types

This section is empty.

Jump to

Keyboard shortcuts

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