file

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: Unlicense Imports: 8 Imported by: 9

Documentation

Overview

Package file implements file related utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src, dst string) error

Copy source file src to destination file dst. The destination file must not exist already. The source file must exist already and be a regular file.

func CopyDir

func CopyDir(src, dst string) error

CopyDir recursively copies the source directory src to destination directory dst. The source directory must exist already and only contain regular files and directories. The destination directory must not exist already.

func CopyDirExclude

func CopyDirExclude(src, dst string, excludePaths []string) error

CopyDirExclude recursively copies the source directory src to destination directory dst, except for paths contained in excludePath. The source directory must exist already and only contain regular files and directories. The destination directory must not exist already.

func Download

func Download(filepath string, url string) error

Download file from url and write it to filepath. If the file with filepath already exists, it will be overwritten!

func Exists

func Exists(filename string) (bool, error)

Exists checks if filename exists already.

func IsBinary

func IsBinary(filename string) (bool, error)

IsBinary returns true if filename is binary and false otherwise. A binary file is defined as a file that doesn't consist entirely of valid UTF-8-encoded runes

func List

func List(dir string) ([]string, error)

List all entries in dir return them as string array.

func RemoveAll

func RemoveAll(path string, excludePaths []string) error

RemoveAll removes all files and directories in path except the ones given in excludePaths.

Types

This section is empty.

Jump to

Keyboard shortcuts

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