Max Friel
unread,May 27, 2010, 7:34:23 PM5/27/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Group,
I am sure I am missing something incredibly simple and stupid here,
but I can not get the ioutil.WriteFile to set the proper permissions
for the file its creating. I am trying to get read and write
permissions for all users. Here are the three attempts I made at
using the function along with the file they output...
ioutil.WriteFile("fs.log", bytes.NewBufferString(out).Bytes(),0666)
-rw-r--r-- 1 root root 77 2010-05-27 19:24 fs.log
ioutil.WriteFile("fs.log", bytes.NewBufferString(out).Bytes(),666)
--w---x--T 1 root root 74 2010-05-27 19:25 fs.log
ioutil.WriteFile("fs.log", bytes.NewBufferString(out).Bytes(),0677)
-rw-r-xr-x 1 root root 77 2010-05-27 19:26 fs.log
Any thoughts as to what the correct integer for permissions would be
as well as why it does appear to be working as I would expect, ie 0666
being read/write permissions for all users.