@@ -20,6 +20,7 @@ const (
2020var (
2121 _ = (fs .NodeReaddirer )((* groupNode )(nil ))
2222 _ = (fs .NodeLookuper )((* groupNode )(nil ))
23+ _ = (fs .NodeGetattrer )((* groupNode )(nil ))
2324)
2425
2526type groupNode struct {
@@ -40,7 +41,6 @@ func newGroupNode(namespace, group string) *groupNode {
4041 isNoGroupPlaceholder : group == NoGroupFolder ,
4142 }
4243}
43-
4444func (groupNode * groupNode ) getRequestAttributes () libdatamanager.FileAttributes {
4545 // Don't send any group to get
4646 // all files without groups
@@ -57,7 +57,9 @@ func (groupNode *groupNode) getRequestAttributes() libdatamanager.FileAttributes
5757
5858// List files in group
5959func (groupNode * groupNode ) Readdir (ctx context.Context ) (fs.DirStream , syscall.Errno ) {
60+ fmt .Println ("readdir node" )
6061 r := make ([]fuse.DirEntry , 0 )
62+
6163 files , err := data .loadFiles (groupNode .getRequestAttributes ())
6264 if err != nil {
6365 return nil , syscall .EIO
@@ -68,15 +70,24 @@ func (groupNode *groupNode) Readdir(ctx context.Context) (fs.DirStream, syscall.
6870 Mode : syscall .S_IFREG ,
6971 Name : files [i ].Name ,
7072 })
71-
72- fmt .Println (files [i ].Name )
7373 }
7474
7575 groupNode .files = files
76-
7776 return fs .NewListDirStream (r ), 0
7877}
7978
79+ func (groupNode * groupNode ) loadfiles () error {
80+ fmt .Println ("readdir node" )
81+
82+ files , err := data .loadFiles (groupNode .getRequestAttributes ())
83+ if err != nil {
84+ return err
85+ }
86+
87+ groupNode .files = files
88+ return nil
89+ }
90+
8091func (groupNode * groupNode ) Lookup (ctx context.Context , name string , out * fuse.EntryOut ) (* fs.Inode , syscall.Errno ) {
8192 file := groupNode .findFile (name )
8293 if file == nil {
@@ -106,3 +117,10 @@ func (groupNode *groupNode) findFile(name string) *libdatamanager.FileResponseIt
106117
107118 return nil
108119}
120+
121+ // Set file attributes
122+ func (groupNode * groupNode ) Getattr (ctx context.Context , f fs.FileHandle , out * fuse.AttrOut ) syscall.Errno {
123+ out .Mode = 0700
124+ data .setUserAttr (out )
125+ return 0
126+ }
0 commit comments