os

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies a file. It truncates the destination file if it exists.

func EnsureDir

func EnsureDir(dir string, mode os.FileMode) error

EnsureDir ensures the given directory exists, creating it if necessary. Errors if the path already exists as a non-directory.

func FileExists

func FileExists(filePath string) bool

FileExists returns true if the given file exists.

func ReadFile

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

ReadFile reads the given file and returns its contents.

func WriteFile

func WriteFile(filePath string, contents []byte, mode os.FileMode) error

WriteFile writes the given contents to the given file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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