os: add file.Truncate

This commit is contained in:
leongross
2024-08-02 08:22:46 -07:00
committed by GitHub
parent 417a26d20c
commit a8a532f9d6
6 changed files with 116 additions and 12 deletions
-10
View File
@@ -290,16 +290,6 @@ func (f *File) Sync() (err error) {
return
}
// Truncate is a stub, not yet implemented
func (f *File) Truncate(size int64) (err error) {
if f.handle == nil {
err = ErrClosed
} else {
err = ErrNotImplemented
}
return &PathError{Op: "truncate", Path: f.name, Err: err}
}
// LinkError records an error during a link or symlink or rename system call and
// the paths that caused it.
type LinkError struct {