I've forgotten that I've built a function to copy preserving permissions:srcFile, err := os.Open("source")
handle(err)
srcInfo, err := os.Stat("source")
handle(err)
dstFile, err := os.OpenFile("dest", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, srcInfo.Mode().Perm())
handle(err)
On Thu, Aug 2, 2012 at 2:42 PM, Archos <raul...@sent.com> wrote:I've forgotten that I've built a function to copy preserving permissions:srcFile, err := os.Open("source")
handle(err)
srcInfo, err := os.Stat("source")
handle(err)
dstFile, err := os.OpenFile("dest", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, srcInfo.Mode().Perm())
handle(err)Opening a file with those permissions makes them subject to your process's umask. Using syscall.Chmod seems like a more likely way to actually get the correct permissions.