fileop

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OS

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

OS provides file operations on the real filesystem.

func New

func New(newHash func() hash.Hash) *OS

New creates a new file operation helper.

func NewDefault

func NewDefault() *OS

NewDefault creates a new file operation helper with a default hash function.

func (*OS) Copy

func (o *OS) Copy(src, dst string) error

Copy copies a file from src to dst. It will overwrite the destination file in any case.

func (*OS) CopyOnDiff

func (o *OS) CopyOnDiff(src, dst string) (bool, error)

CopyOnDiff copies a file from src to dst. It will only modify the destination file if the contents are different. It returns true if the file was modified, or an error if any occurred.

func (*OS) Move

func (o *OS) Move(src, dst string) error

Move moves a file from src to dst.

Jump to

Keyboard shortcuts

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