MCPcopy Create free account
hub / github.com/plexdrive/plexdrive / ReadDirAll

Method ReadDirAll

mount/mount.go:276–298  ·  view source on GitHub ↗

ReadDirAll shows all files in the current directory

(ctx context.Context)

Source from the content-addressed store, hash-verified

274
275// ReadDirAll shows all files in the current directory
276func (o Object) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
277 objects, err := o.fs.client.GetObjectsByParent(o.objectID)
278 if nil != err {
279 Log.Debugf("%v", err)
280 return nil, fuse.ENOENT
281 }
282
283 dirs := []fuse.Dirent{}
284 for _, object := range objects {
285 if object.IsDir {
286 dirs = append(dirs, fuse.Dirent{
287 Name: object.Name,
288 Type: fuse.DT_Dir,
289 })
290 } else {
291 dirs = append(dirs, fuse.Dirent{
292 Name: object.Name,
293 Type: fuse.DT_File,
294 })
295 }
296 }
297 return dirs, nil
298}
299
300// Lookup tests if a file is existent in the current directory
301func (o Object) Lookup(ctx context.Context, name string) (fs.Node, error) {

Callers

nothing calls this directly

Calls 1

GetObjectsByParentMethod · 0.45

Tested by

no test coverage detected