mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 14:03:39 +00:00
os/file: add file.Chmod
Signed-off-by: leongross <leon.gross@9elements.com>
This commit is contained in:
@@ -307,6 +307,17 @@ func (f *File) Sync() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// Chmod changes the mode of the file to mode. If there is an error, it will be
|
||||
// of type *PathError.
|
||||
func (f *File) Chmod(mode FileMode) (err error) {
|
||||
if f.handle == nil {
|
||||
err = ErrClosed
|
||||
} else {
|
||||
err = f.chmod(mode)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// LinkError records an error during a link or symlink or rename system call and
|
||||
// the paths that caused it.
|
||||
type LinkError struct {
|
||||
|
||||
Reference in New Issue
Block a user