Added time info.
parent
5514405606
commit
1750a271f5
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue