mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-21 21:09:02 +00:00
os: add File.Chown on the unix path
file_unix.go (darwin/linux/wasip) was missing the exported (*File).Chown method that file_other.go (baremetal/wasm) already has, so callers requiring the full os.File surface — e.g. github.com/pkg/sftp — failed to compile for the linux/amd64 TinyGo target. Delegates to the package-level Chown, mirroring (*File).Truncate.
This commit is contained in:
committed by
Damian Gryski
parent
338af91ae6
commit
ac45c35924
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user