Add more meta information to trove entries

This commit is contained in:
Andrew Mulbrook 2026-03-22 23:57:05 -05:00
parent 4ada169bbe
commit bd4d571c95
5 changed files with 80 additions and 7 deletions

View file

@ -194,20 +194,26 @@ class TroveFuseOps(pyfuse3.Operations):
attr.st_nlink = 1
attr.st_uid = os.getuid()
attr.st_gid = os.getgid()
mtime_ns = int(note.mtime.timestamp() * 1e9)
now_ns = int(time.time() * 1e9)
attr.st_atime_ns = now_ns
attr.st_mtime_ns = now_ns
attr.st_ctime_ns = now_ns
attr.st_mtime_ns = mtime_ns
attr.st_ctime_ns = mtime_ns
attr.generation = 0
attr.entry_timeout = 5.0
attr.attr_timeout = 5.0
# Determine permissions based on readonly property
if is_tree:
attr.st_mode = stat.S_IFDIR | 0o755
mode = 0o755 if not note.readonly else 0o555
attr.st_mode = stat.S_IFDIR | mode
attr.st_size = 0
attr.st_blksize = 512
attr.st_blocks = 0
else:
attr.st_mode = stat.S_IFREG | 0o644
mode = 0o644 if not note.readonly else 0o444
attr.st_mode = stat.S_IFREG | mode
attr.st_size = size
attr.st_blksize = 512
attr.st_blocks = (size + 511) // 512