mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 15:03:41 +00:00
os: add File.Chdir support
We should really be using syscall.Fchdir here, but this is a fix to get Go 1.24 working.
This commit is contained in:
committed by
Ron Evans
parent
c2eaa495df
commit
cdea833b5c
@@ -318,6 +318,17 @@ func (f *File) Chmod(mode FileMode) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// Chdir changes the current working directory to the file, which must be a
|
||||
// directory. If there is an error, it will be of type *PathError.
|
||||
func (f *File) Chdir() (err error) {
|
||||
if f.handle == nil {
|
||||
err = ErrClosed
|
||||
} else {
|
||||
err = f.chdir()
|
||||
}
|
||||
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