mount: add "." and ".." to directories to match cmount and expectations

See: https://forum.rclone.org/t/empty-directorys-size-for-a-mounted-crypt-remote/21077
This commit is contained in:
Nick Craig-Wood 2020-12-16 10:57:02 +00:00
parent c98dd8755c
commit e45716cac2

View File

@ -108,6 +108,13 @@ func (d *Dir) ReadDirAll(ctx context.Context) (dirents []fuse.Dirent, err error)
if err != nil {
return nil, translateError(err)
}
dirents = append(dirents, fuse.Dirent{
Type: fuse.DT_Dir,
Name: ".",
}, fuse.Dirent{
Type: fuse.DT_Dir,
Name: "..",
})
for _, node := range items {
name := node.Name()
if len(name) > mountlib.MaxLeafSize {