mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
vfs: factor duplicated Open code into vfs from mount/cmount
This commit is contained in:
@@ -19,11 +19,27 @@ func newDirHandle(d *Dir) *DirHandle {
|
||||
}
|
||||
}
|
||||
|
||||
// String converts it to printable
|
||||
func (fh *DirHandle) String() string {
|
||||
if fh == nil {
|
||||
return "<nil *DirHandle>"
|
||||
}
|
||||
if fh.d == nil {
|
||||
return "<nil *DirHandle.d>"
|
||||
}
|
||||
return fh.d.String() + " (r)"
|
||||
}
|
||||
|
||||
// Stat returns info about the current directory
|
||||
func (fh *DirHandle) Stat() (fi os.FileInfo, err error) {
|
||||
return fh.d, nil
|
||||
}
|
||||
|
||||
// Node returns the Node assocuated with this - satisfies Noder interface
|
||||
func (fh *DirHandle) Node() Node {
|
||||
return fh.d
|
||||
}
|
||||
|
||||
// Readdir reads the contents of the directory associated with file and returns
|
||||
// a slice of up to n FileInfo values, as would be returned by Lstat, in
|
||||
// directory order. Subsequent calls on the same file will yield further
|
||||
|
||||
Reference in New Issue
Block a user