Adds Sync to platform.File (#1426)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Crypt Keeper
2023-05-02 13:16:50 +08:00
committed by GitHub
parent d5a2d3c7b4
commit b79c45b91c
7 changed files with 175 additions and 63 deletions

View File

@@ -187,6 +187,15 @@ func (r *lazyDir) Chown(uid, gid int) syscall.Errno {
}
}
// Sync implements the same method as documented on platform.File
func (r *lazyDir) Sync() syscall.Errno {
if f, ok := r.file(); !ok {
return syscall.EBADF
} else {
return f.Sync()
}
}
// File implements the same method as documented on platform.File
func (r *lazyDir) File() fs.File {
if f, ok := r.file(); !ok {