diff --git a/file_system.go b/file_system.go index 46aaccf..7bcbabb 100644 --- a/file_system.go +++ b/file_system.go @@ -90,8 +90,11 @@ const RootInodeID InodeID = InodeID(bazilfuse.RootID) // Attributes for a file or directory inode. Corresponds to struct inode (cf. // http://goo.gl/tvYyQt). type InodeAttributes struct { - Size uint64 - Mode os.FileMode + Size uint64 + Mode os.FileMode + Atime time.Time + Mtime time.Time + Crtime time.Time } // A generation number for an inode. Irrelevant for file systems that won't be diff --git a/samples/hello_fs.go b/samples/hello_fs.go index 0856351..e755702 100644 --- a/samples/hello_fs.go +++ b/samples/hello_fs.go @@ -139,6 +139,12 @@ func (fs *HelloFS) LookUpInode( resp.Child = childInode resp.Attributes = gInodeInfo[childInode].attributes + // Patch attributes. + now := fs.Clock.Now() + resp.Attributes.Atime = now + resp.Attributes.Mtime = now + resp.Attributes.Crtime = now + return } @@ -158,6 +164,12 @@ func (fs *HelloFS) GetInodeAttributes( // Copy over its attributes. resp.Attributes = info.attributes + // Patch attributes. + now := fs.Clock.Now() + resp.Attributes.Atime = now + resp.Attributes.Mtime = now + resp.Attributes.Crtime = now + return } diff --git a/server.go b/server.go index 25b0ce0..0415643 100644 --- a/server.go +++ b/server.go @@ -206,8 +206,11 @@ func (s *server) handleFuseRequest(fuseReq bazilfuse.Request) { func convertAttributes(inode InodeID, attr InodeAttributes) bazilfuse.Attr { return bazilfuse.Attr{ - Inode: uint64(inode), - Size: attr.Size, - Mode: attr.Mode, + Inode: uint64(inode), + Size: attr.Size, + Mode: attr.Mode, + Atime: attr.Atime, + Mtime: attr.Mtime, + Crtime: attr.Crtime, } }