mirror of
https://github.com/rclone/rclone.git
synced 2025-07-01 04:50:12 +02:00
vfs: Make file handles compatible with OS
* Implement directory handles * Unify OpenFile * Add all the methods to match *os.File * Add StatParent and Rename methods to VFS
This commit is contained in:
@ -2,6 +2,7 @@ package vfs
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@ -10,6 +11,7 @@ import (
|
||||
|
||||
// WriteFileHandle is an open for write handle on a File
|
||||
type WriteFileHandle struct {
|
||||
baseHandle
|
||||
mu sync.Mutex
|
||||
closed bool // set if handle has been closed
|
||||
remote string
|
||||
@ -195,6 +197,11 @@ func (fh *WriteFileHandle) Release() error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Stat returns info about the file
|
||||
func (fh *WriteFileHandle) Stat() (os.FileInfo, error) {
|
||||
return fh.file, nil
|
||||
}
|
||||
|
||||
// Close closes the file calling Flush then Release
|
||||
func (fh *WriteFileHandle) Close() error {
|
||||
err := fh.Flush()
|
||||
|
Reference in New Issue
Block a user