func (self *ACL) SetFile(path string, typ Type) error { cpath := C.CString(path) ret, err := C.acl_set_file(cpath, C.acl_type_t(typ), self.ptr) if ret != 0 && err != nil { return err } return nil }
func (acl *ACL) setFile(path string, tp C.acl_type_t) error { if !acl.Valid() { if err := acl.addBaseEntries(path); err != nil { return err } if !acl.Valid() { return fmt.Errorf("Invalid ACL: %s", acl) } } rv, _ := C.acl_set_file(C.CString(path), tp, acl.a) if rv < 0 { return fmt.Errorf("unable to apply ACL to file") } return nil }