Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (17 sloc) 491 Bytes
package acl
import (
"os"
)
// Change the permissions of the specified file. Only the nine
// least-significant bytes are used, allowing access by the file's owner, the
// file's group, and everyone else to be explicitly controlled.
func Chmod(name string, mode os.FileMode) error {
return Apply(
name,
true,
false,
GrantName((uint32(mode)&0700)<<23, "CREATOR OWNER"),
GrantName((uint32(mode)&0070)<<26, "CREATOR GROUP"),
GrantName((uint32(mode)&0007)<<29, "EVERYONE"),
)
}