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) {
|
func copyFile(src, dst string) {
|
||||||
srcF, err := os.Open(src, os.O_RDONLY, 0)
|
txt := mustReadFile(src)
|
||||||
check(err)
|
|
||||||
dstF, err := os.Create(dst)
|
dstF, err := os.Create(dst)
|
||||||
check(err)
|
check(err)
|
||||||
err = io.Copy(srcF, dstF)
|
fmt.Fprint(dstF, txt)
|
||||||
check(err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func pipe(bin string, arg []string, src string) []byte {
|
func pipe(bin string, arg []string, src string) []byte {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user