Documentation
¶
Index ¶
- func CopyBytes(in []byte, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func CopyFileContents(src, dst string) (err error)
- func CopyReader(in io.Reader, dst string) (err error)
- func CopyReaderInfo(in io.Reader, info os.FileInfo, dst string) (err error)
- func CopyTree(dest string, sources []Copier) (err error)
- func CreateFile(filename string, r io.Reader, info os.FileInfo, opt WriteMode) (err error)
- func CreateFileSync(filename string, r io.Reader, info os.FileInfo) (err error)
- func SetInfo(pth string, info os.FileInfo) (err error)
- type Copier
- type Destation
- type Dir
- type Sourcer
- type Src
- type SrcData
- type SrcReader
- type WriteMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. Otherise, attempt to create a hard link between the two files. If that fail, copy the file contents from src to dst.
func CopyFileContents ¶
CopyFileContents copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file.
func CreateFile ¶
CreateFile writes data to a file named by filename. If the file does not exist, CreateFile creates it with permissions perm; otherwise CreateFile truncates it before writing.
func CreateFileSync ¶
CreateFileSync writes data to a file named by filename and set perms and times. If the file does not exist, CreateFile creates it with permissions perm; otherwise CreateFile truncates it before writing.
Types ¶
type WriteMode ¶
type WriteMode int
const ( WO_SetPerm WriteMode = 1 << iota WO_SetTimes Wo_Sync WO_ALL = WO_SetPerm | WO_SetTimes )