Documentation
¶
Overview ¶
Package cp implements the cp core utility.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = Options{}
Default are the default options. Default follows symlinks.
View Source
var ErrSkip = errors.New("skip")
ErrSkip can be returned by PreCallback to skip a file.
View Source
var NoFollowSymlinks = Options{ NoFollowSymlinks: true, }
NoFollowSymlinks is the default options with following symlinks turned off.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// If NoFollowSymlinks is set, Copy copies the symlink itself rather
// than following the symlink and copying the file it points to.
NoFollowSymlinks bool
// PreCallback is called on each file to be copied before it is copied
// if specified.
//
// If PreCallback returns ErrSkip, the file is skipped and Copy returns
// nil.
//
// If PreCallback returns another non-nil error, the file is not copied
// and Copy returns the error.
PreCallback func(src, dst string, srcfi os.FileInfo) error
// PostCallback is called on each file after it is copied if specified.
PostCallback func(src, dst string)
// WorkingDir is the working directory for relative path resolution.
WorkingDir string
}
Options are configuration options for how copying files should behave.
Click to show internal directories.
Click to hide internal directories.