info, _ := os.Stat(path)
os.Chmod(path, uint32(info.Mode()|0111))
Is there any reason not to change os.Chmod? I couldn't find any
previous discussion. os.OpenFile has the same issue.
- Evan
The current definition of os.Chmod permits the program to set the sticky
bit (01000). Changing the second parameter to FileMode as it stands
today would not permit that. I think that would have to be addressed
one way or another.
Ian
Is it just because there's no defined constant for the sticky bit?
Right now one can use an integer literal and it's easy to add a
constant, so I must be missing something.
- Evan
In your example of
os.Chmod(path, uint32(info.Mode()|0111))
the sticky bit would be unintentionally cleared.
It's fixable, it just has to be done.
Ian
Not very sticky then, is it?
-rob
Russ
It's a Go 1 thing and there's no bug as far as I know.
- Evan
Done: http://code.google.com/p/go/issues/detail?id=2733
- Evan