Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/os/file_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ func (f *File) Truncate(size int64) (err error) {
return Truncate(f.name, size)
}

// Chown changes the numeric uid and gid of the named file.
// A uid or gid of -1 means to not change that value.
// If there is an error, it will be of type *PathError.
func (f *File) Chown(uid, gid int) error {
if f.handle == nil {
return ErrClosed
}

return Chown(f.name, uid, gid)
}

func (f *File) chmod(mode FileMode) error {
if f.handle == nil {
return ErrClosed
Expand Down
Loading