utl

package
v0.0.0-...-1f62197 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 Exists

func Exists(name string) bool

Exists reports whether the named file or directory exists

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 GetEnv

func GetEnv(key string) string

GetEnv get system env

func IsDirEmpty

func IsDirEmpty(name string) (bool, error)

IsDirEmpty determines if directory is empty

func OverrideEnv

func OverrideEnv(key string, value string)

OverrideEnv to override an env var

func PathJoin

func PathJoin(elem ...string) string

PathJoin to join paths

func ReadLines

func ReadLines(filePath string) []string

ReadLines read file

func RemoveContents

func RemoveContents(dir string) error

RemoveContents remove contents of a specified directory

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 reports 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