Skip to content

[Feature request] expose filesystem inode information #301

@gustavo-iniguez-goya

Description

@gustavo-iniguez-goya

Hi!

Thanks for this package, really useful!

Currently, filesystem.Stat returns the information of a path in a fs.FileInfo struct: https://pkg.go.dev/github.com/diskfs/go-diskfs@v1.7.0/filesystem/ext4#FileSystem.Stat

This struct doesn't offer all the fields that for example the ext4 format has, like the inode.

There're some structs that could expose their internal fields:

type Directory struct {

type directoryEntry struct {

*directoryEntry
*inode

https://github.com/diskfs/go-diskfs/blob/master/filesystem/ext4/inode.go#L110

For example, the stat command shows much more information than what the FileInfo struct offers:

~ $ stat .
  File: .
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
 Device: 253,3	Inode: 3977042     Links: 7
 Access: (0775/drwxrwxr-x)  Uid: ( 1000/      ga)   Gid: ( 1000/      ga)
 Context: unconfined_u:object_r:user_home_t:s0
 Access: 2025-09-30 23:17:38.833369333 +0200
 Modify: 2025-09-30 23:17:37.589361321 +0200
 Change: 2025-09-30 23:17:37.589361321 +0200
 Birth: 2025-09-26 00:21:16.319751387 +0200

More like Stat_t: https://pkg.go.dev/golang.org/x/sys/unix#Stat_t

For some applications, having access to this information would be quite useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions