fileutil

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// file modes
	DefaultDirFileMode  = 0750
	DefaultFileMode     = 0644
	DefaultExecFileMode = 0755

	DefaultFileFlags = os.O_WRONLY | os.O_CREATE
)

Variables

This section is empty.

Functions

func DotPath added in v0.14.0

func DotPath(path string) string

DotPath appends a current working directory dot, ex. "./" in Unix, to paths that do not already have one or are not absolute.

func IsClosedError added in v0.4.0

func IsClosedError(e error) bool

Types

type FileWriter

type FileWriter struct {
	// contains filtered or unexported fields
}

FileWriter is a io wrapper to write files

func NewFileWriterFS added in v0.5.0

func NewFileWriterFS(fs afero.Fs) *FileWriter

func (*FileWriter) GetFS added in v0.5.0

func (fw *FileWriter) GetFS() afero.Fs

func (*FileWriter) WriteCloser

func (fw *FileWriter) WriteCloser(path string, mode os.FileMode) (io.Writer, error)

WriteCloser returns a WriteCloser to write to given path

func (*FileWriter) WriteFile

func (fw *FileWriter) WriteFile(filePath string, content []byte) error

WriteFile write given content to the file path

Jump to

Keyboard shortcuts

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