mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 22:43:40 +00:00
os: add os.(*File).Sync
Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
This commit is contained in:
committed by
Ron Evans
parent
4fa6a132e2
commit
ccfe92a58c
@@ -247,6 +247,18 @@ func (f *File) Fd() uintptr {
|
||||
return ^uintptr(0)
|
||||
}
|
||||
|
||||
// Sync commits the current contents of the file to stable storage.
|
||||
// Typically, this means flushing the file system's in-memory copy of recently
|
||||
// written data to disk.
|
||||
func (f *File) Sync() (err error) {
|
||||
if f.handle == nil {
|
||||
err = ErrClosed
|
||||
} else {
|
||||
err = f.handle.Sync()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Truncate is a stub, not yet implemented
|
||||
func (f *File) Truncate(size int64) (err error) {
|
||||
if f.handle == nil {
|
||||
|
||||
Reference in New Issue
Block a user