mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 18:53:29 +00:00
fix: add missing Truncate() function stub to os/file for bare-metal systems
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -135,3 +135,17 @@ func Readlink(name string) (string, error) {
|
|||||||
func tempDir() string {
|
func tempDir() string {
|
||||||
return "/tmp"
|
return "/tmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Truncate is unsupported on this system.
|
||||||
|
func Truncate(filename string, size int64) (err error) {
|
||||||
|
return ErrUnsupported
|
||||||
|
}
|
||||||
|
|
||||||
|
// Truncate is unsupported on this system.
|
||||||
|
func (f *File) Truncate(size int64) (err error) {
|
||||||
|
if f.handle == nil {
|
||||||
|
return ErrClosed
|
||||||
|
}
|
||||||
|
|
||||||
|
return Truncate(f.name, size)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user