Commit ba419785 authored by Francesc Campoy's avatar Francesc Campoy

go/misc/dist: Keep file modes when copying.

R=adg
CC=golang-dev
https://golang.org/cl/7221055
parent 3bf3ba2d
......@@ -611,11 +611,18 @@ func cp(dst, src string) error {
return err
}
defer sf.Close()
fi, err := sf.Stat()
if err != nil {
return err
}
df, err := os.Create(dst)
if err != nil {
return err
}
defer df.Close()
if err := df.Chmod(fi.Mode()); err != nil {
return err
}
_, err = io.Copy(df, sf)
return err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment