file copying how does it work
This commit is contained in:
parent
a8fd1a1c40
commit
367cf27324
@ -29,12 +29,10 @@ func ensureDir(dir string) {
|
||||
}
|
||||
|
||||
func copyFile(src, dst string) {
|
||||
srcF, err := os.Open(src, os.O_RDONLY, 0)
|
||||
check(err)
|
||||
txt := mustReadFile(src)
|
||||
dstF, err := os.Create(dst)
|
||||
check(err)
|
||||
err = io.Copy(srcF, dstF)
|
||||
check(err)
|
||||
fmt.Fprint(dstF, txt)
|
||||
}
|
||||
|
||||
func pipe(bin string, arg []string, src string) []byte {
|
||||
|
Loading…
x
Reference in New Issue
Block a user