fileutil

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Overview

Package fileutil implements file utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src, dst string) error

Copy copies a file.

func EnsureExecutable added in v0.4.4

func EnsureExecutable(p string) error

EnsureExecutable sets the executable file mode bits, for all users, to ensure that we can execute a file

func Exist

func Exist(name string) bool

Exist returns true if a file or directory exists.

func GetTempFilePath added in v1.1.6

func GetTempFilePath() (path string, err error)

GetTempFilePath creates a file path to a temporary file that does not exist yet.

func IsDirWriteable added in v1.1.8

func IsDirWriteable(dir string) error

IsDirWriteable checks if dir is writable by writing and removing a file. It returns error if dir is NOT writable. If the director does not exist, it returns nil.

func MkTmpDir added in v1.1.3

func MkTmpDir(baseDir string, pfx string) (dir string)

MkTmpDir creates a temp directory.

func WriteTempFile

func WriteTempFile(d []byte) (path string, err error)

WriteTempFile writes data to a temporary file.

func WriteToTempDir

func WriteToTempDir(p string, d []byte) (path string, err error)

WriteToTempDir writes data to a temporary directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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