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
13 changes: 13 additions & 0 deletions src/os/file_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,19 @@ func (f *File) Truncate(size int64) (err error) {
return Truncate(f.name, size)
}

// Chown changes the numeric uid and gid of the named file. It mirrors Truncate:
// the unix os.File was missing this method (it exists only on the baremetal/wasm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the history of the change is not necessary to stay as a code comment when its not relevant to the implementation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Please change the comment to simply document os.Chown.

// path in file_other.go), which broke callers such as github.com/pkg/sftp that
// require the full os.File surface. Delegates to the package-level Chown
// (file_anyos.go) on the file's path.
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