Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'd like to get the username associated with a file, not just the uid #130

Open
LisaAlmarode opened this issue Mar 8, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@LisaAlmarode
Copy link
Member

A FileReference can answer its uid and gid, the numeric value of the userid. It would be quite useful to be able to resolve this into the username.

@LisaAlmarode LisaAlmarode added the enhancement New feature or request label Mar 8, 2023
@martinmcclure
Copy link
Member

The thread-safe functions to obtain user and group names are getpwuid_r() and getgrgid_r().
Note that it is never guaranteed that there exists a name for a given UID or GID. One example is that of an NFS file server, which might contain files owned by users that do not appear in any password database that it has access to.

I suggest two levels of API; a high-level message that answers the print string of the numeric ID if no name is found, and a lower-level message that signals an exception if not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants