files

package
v0.0.0-...-f4175bf Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile

func CreateFile(path string) *os.File

CreateFile creates a file at the specified path. If it encounters any errors, it logs them and ends the program.

func DeleteFile

func DeleteFile(path string)

DeleteFile deletes the file at the specified path. If it encounters any errors, it logs them and ends the program.

func FileInfo

func FileInfo(path string) os.FileInfo

FileStats returns the info on the given file. If any errors are encountered, it logs the error and then ends the program.

func FileSize

func FileSize(file *os.File) int64

FileSize returns the size of the specified file. If it encounters any errors, it logs them and ends the program.

func OpenFile

func OpenFile(path string) *os.File

OpenFile opens the file at the specified location. If it encounters any errors, it logs them and ends the program.

func OverwriteFile

func OverwriteFile(file *os.File, contents []byte)

OverwriteFile overwrites the previous contents of the passed in file with the specified contents. If it encounters any errors, it logs them and ends the program.

func ReadFile

func ReadFile(file *os.File) []byte

ReadFile reads all of the contents of the specified file into a byte slice and returns that slice. If any errors are encountered along the way, it logs the error and ends the program.

func Symlink(oldname string, newname string)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳