Skip to content

Add uid/gid fields to FsStat and name resolution callbacks for ls/stat#150

Open
deathbyknowledge wants to merge 2 commits intovercel-labs:mainfrom
deathbyknowledge:uid-gid-resolvers
Open

Add uid/gid fields to FsStat and name resolution callbacks for ls/stat#150
deathbyknowledge wants to merge 2 commits intovercel-labs:mainfrom
deathbyknowledge:uid-gid-resolvers

Conversation

@deathbyknowledge
Copy link
Copy Markdown

First off, this is an awesome project!

I have a custom IFileSystem implementation that has its own file ownership. Currently ls -l hardcodes user user and stat hardcodes 1000/user, making the ownership invisible. I've tried fixing this in a backwards compatible way, happy to amend as necessary.

  • Added optional uid and gid fields to FsStat interface
  • Added uidToName/gidToName callback options to BashOptions for resolving numeric IDs to names
  • ls -l now uses real stat.mode via formatMode() instead of hardcoding drwxr-xr-x/-rw-r--r--
  • ls -l resolves owner/group names from stat.uid/stat.gid using callbacks (falls back to "user"/"group")
  • stat -c format specifiers %u, %U, %g, %G use real stat values + name resolution
  • All changes are backwards-compatible (undefined uid/gid defaults to 1000, missing callbacks default to "user"/"group")

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 11, 2026

@deathbyknowledge is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant