fileutil

package
Version: v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 8 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 and writes/overwrites to the destination file.

func CopyAppend added in v1.2.7

func CopyAppend(src, dst string) error

CopyAppend copies a file and appends to the destination 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)

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.

Source Files

Jump to

Keyboard shortcuts

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