Skip to content

Commit

Permalink
Remove the device and inode numbers from the API.
Browse files Browse the repository at this point in the history
As discussed [here], remove the fields which correspond to `st_dev`, `st_ino`,
and `d_ino` in POSIX from the stat and directory entry structs.

 - Device numbers assume the existence of a global device number space,
   which creates implicit relationships between otherwise unrelated
   components.

 - Not all filesystem implementations have these numbers. And some that
   do have these numbers require extra implementation cost to retrieve them.

 - These numbers leak potentially sensitive or identifying information from the
   underlying filesystem implementation.

In their place, provide some functions, `is-same-object`,
`metadata-hash`, and `metadata-hash-at`, for explicitly testing whether two
handles are the same file or have the same metadata, respectively. This doesn't
cover all possible use cases for device and inode numbers, but we can
add more functions as need arises.

[here]: WebAssembly#65 (comment)
  • Loading branch information
sunfishcode committed Jul 20, 2023
1 parent ef9fc87 commit 58e3e5d
Showing 1 changed file with 258 additions and 228 deletions.
Loading

0 comments on commit 58e3e5d

Please sign in to comment.