Skip to content

Conversation

@oboard
Copy link

@oboard oboard commented Dec 1, 2025

Implement stat functionality to retrieve file metadata including size, timestamps, and permissions. Added native, wasm and JS implementations with tests. The Stats struct contains comprehensive file system information.

Add cross-platform support for stat details with proper handling of platform-specific fields. Includes tests to verify basic functionality and metadata correctness.

///|
pub struct Stats {
  dev : UInt64
  mode : UInt
  nlink : UInt64
  ino : UInt64
  uid : UInt
  gid : UInt
  rdev : UInt64
  atime_sec : Int64
  atime_nsec : Int64
  mtime_sec : Int64
  mtime_nsec : Int64
  ctime_sec : Int64
  ctime_nsec : Int64
  birthtime_sec : Int64
  birthtime_nsec : Int64
  size : Int64
  blocks : UInt64
  blksize : UInt
  flags : UInt
  gen : UInt
  lspare : Int
  qspare : (Int64, Int64)
} derive(Show, Eq)

Implement stat functionality to retrieve file metadata including size, timestamps, and permissions. Added native, wasm and JS implementations with tests. The Stats struct contains comprehensive file system information.

Add cross-platform support for stat details with proper handling of platform-specific fields. Includes tests to verify basic functionality and metadata correctness.
@peter-jerry-ye
Copy link
Collaborator

For the Wasm backend, it would be necessary to update the moonrun as well. See #201 as an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants