fsutil

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(fs afero.Fs, src, dest string) error

CopyDir recursively copies a directory into a given destination.

func CopyFile

func CopyFile(fs afero.Fs, src, dest string, perm os.FileMode) error

CopyFile copies a file into a given destination.

func CopyReader

func CopyReader(fs afero.Fs, r io.Reader, dest string, perm os.FileMode) error

CopyReader copies an io.Reader into a given destination.

func DetectMediaType

func DetectMediaType(fs afero.Fs, path string) (string, error)

DetectMediaType detects a file's media type, as defined in https://www.iana.org/assignments/media-types/media-types.xhtml.

func ReadSecureFile

func ReadSecureFile(fs afero.Fs, filename string) ([]byte, error)

ReadSecureFile ensures a file has 0400 or 0600 permissions before reading it. Permissions check is skipped on Windows as it uses a different mechanism than UNIX.

func Unzip

func Unzip(fs afero.Fs, src, dest string) error

Unzip extracts a ZIP archive into a given destination.

Types

This section is empty.

Jump to

Keyboard shortcuts

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