Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
Copy copies a file from src to dst. It returns the number of bytes copied and/or an error.
func ExpandPath ¶
ExpandPath expands the ~ into to the setting of the $HOME variable.
Types ¶
type AtomicWrite ¶
type AtomicWrite struct {
// contains filtered or unexported fields
}
AtomicWrite atomically writes files by using a temp file. When Close is called the temp file is closed and moved to its final destination.
func NewAtomicWrite ¶
func NewAtomicWrite(dst string) *AtomicWrite
NewAtomicWrite creates a io.WriteCloser to atomically write files.
func (*AtomicWrite) Close ¶
func (a *AtomicWrite) Close() error
Close closes the temporary file and moves to the destination
type Info ¶
type Info interface {
Name() string // base name of the file
Size() int64 // length in bytes for regular files; system-dependent for others
Mode() fs.FileMode // file mode bits
ModTime() time.Time // modification time
IsDir() bool // abbreviation for Mode().IsDir()
Sys() interface{} // underlying data source (can return nil)
Path() string // path to file
Abs() string // absolute path to file
Exists() bool // true if file exists
}
A Info describes a file and is returned by Stat.
Click to show internal directories.
Click to hide internal directories.