mirror of
https://github.com/rclone/rclone.git
synced 2025-02-17 05:02:44 +08:00
mountlib: add DirEntry() to Node interface
This commit is contained in:
parent
3af9d63261
commit
8b6daaa877
|
@ -411,6 +411,11 @@ func (d *Dir) RemoveAll() error {
|
||||||
return d.Remove()
|
return d.Remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DirEntry returns the underlying fs.DirEntry
|
||||||
|
func (d *Dir) DirEntry() (entry fs.DirEntry) {
|
||||||
|
return d.entry
|
||||||
|
}
|
||||||
|
|
||||||
// RemoveName removes the entry with the given name from the receiver,
|
// RemoveName removes the entry with the given name from the receiver,
|
||||||
// which must be a directory. The entry to be removed may correspond
|
// which must be a directory. The entry to be removed may correspond
|
||||||
// to a file (unlink) or to a directory (rmdir).
|
// to a file (unlink) or to a directory (rmdir).
|
||||||
|
|
|
@ -271,3 +271,8 @@ func (f *File) Remove() error {
|
||||||
func (f *File) RemoveAll() error {
|
func (f *File) RemoveAll() error {
|
||||||
return f.Remove()
|
return f.Remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DirEntry returns the underlying fs.DirEntry
|
||||||
|
func (f *File) DirEntry() (entry fs.DirEntry) {
|
||||||
|
return f.o
|
||||||
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ type Node interface {
|
||||||
Fsync() error
|
Fsync() error
|
||||||
Remove() error
|
Remove() error
|
||||||
RemoveAll() error
|
RemoveAll() error
|
||||||
|
DirEntry() fs.DirEntry
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user