utils

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendOnlyFile added in v0.11.0

func AppendOnlyFile(filename string, data []byte) error

AppendOnlyFile appends to an existing file. Fails if the file does not exist.

func FileChecksum added in v0.6.0

func FileChecksum(path string) (string, error)

FileChecksum reads a file and return the Adler32 checksum of its data as a string

func PathExists

func PathExists(path string) (exists bool)

func Touch added in v0.6.0

func Touch(path string, atime, mtime time.Time) error

Touch updates the atime and mtime of a file, after creating it if it doesn't exist.

func WriteFile added in v0.11.0

func WriteFile(filename string, data []byte, perm os.FileMode) error

WriteFile writes data to a new file, or rewrites an existing file.

func WriteNewFile added in v0.7.0

func WriteNewFile(filename string, data []byte, perm os.FileMode) error

WriteNewFile writes data to a new file. Fails if the file exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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