github.com/tetratelabs/wazero@v1.2.1/internal/fsapi/stat.go (about)

     1  package fsapi
     2  
     3  import "io/fs"
     4  
     5  // Stat_t is similar to syscall.Stat_t, and fields frequently used by
     6  // WebAssembly ABI including WASI snapshot-01, GOOS=js and wasi-filesystem.
     7  //
     8  // # Note
     9  //
    10  // Zero values may be returned where not available. For example, fs.FileInfo
    11  // implementations may not be able to provide Ino values.
    12  type Stat_t struct {
    13  	// Dev is the device ID of device containing the file.
    14  	Dev uint64
    15  
    16  	// Ino is the file serial number.
    17  	Ino uint64
    18  
    19  	// Uid is the user ID that owns the file, or zero if unsupported.
    20  	// For example, this is unsupported on some virtual filesystems or windows.
    21  	Uid uint32
    22  
    23  	// Gid is the group ID that owns the file, or zero if unsupported.
    24  	// For example, this is unsupported on some virtual filesystems or windows.
    25  	Gid uint32
    26  
    27  	// Mode is the same as Mode on fs.FileInfo containing bits to identify the
    28  	// type of the file (fs.ModeType) and its permissions (fs.ModePerm).
    29  	Mode fs.FileMode
    30  
    31  	/// Nlink is the number of hard links to the file.
    32  	Nlink uint64
    33  	// ^^ uint64 not uint16 to accept widest syscall.Stat_t.Nlink
    34  
    35  	// Size is the length in bytes for regular files. For symbolic links, this
    36  	// is length in bytes of the pathname contained in the symbolic link.
    37  	Size int64
    38  	// ^^ int64 not uint64 to defer to fs.FileInfo
    39  
    40  	// Atim is the last data access timestamp in epoch nanoseconds.
    41  	Atim int64
    42  
    43  	// Mtim is the last data modification timestamp in epoch nanoseconds.
    44  	Mtim int64
    45  
    46  	// Ctim is the last file status change timestamp in epoch nanoseconds.
    47  	Ctim int64
    48  }