zos

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateWith added in v0.3.0

func CreateWith(path string, handler FileHandler) (err error)

Create a file and use it inside a closure. Will automatically close the file after the closure completes and remove the corrupt file if an error is thrown.

func CreateWithTemp added in v0.3.0

func CreateWithTemp(path string, handler FileHandler) error

Like CreateWith, but will create a temporary file and rename it to the final path once the file has been written successfully. If an error occurs, the temp file will be removed.

func Exists

func Exists(path string) bool

Determine if a path exists or not

Types

type FileHandler added in v0.3.0

type FileHandler = func(f *os.File) error

Jump to

Keyboard shortcuts

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