fileutils

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: Apache-2.0 Imports: 6 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandTilde

func ExpandTilde(fileName string) string

ExpandTilde expands the tilde symbol (~) to the user's home directory This function is also useful for expanding file paths like "~/a/b/c"

func FileExists

func FileExists(fileName string) bool

FileExists checks if the file with the gieven name exists. This function also supports file paths which are pointing to the user's home directory, i.e. starting with ~/

func ReadFile

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

ReadFile reads a file with the given file name and returns its content as a slice of bytes. This function also supports file paths which are pointing to the user's home directory, i.e. starting with ~/

func ReadFileAsStr

func ReadFileAsStr(fileName string) (string, error)

ReadFileAsStr does the same thing as ReadFile but ruturns the content of the file as a string

func UserHomeDir

func UserHomeDir() string

UserHomeDir returns the user's home directory

Types

This section is empty.

Jump to

Keyboard shortcuts

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