I execute the command (ls) on Unix while learning in a book. While coding my implementation of the command (ls) with the flag (- l) , I see that I need to request the names of the users and groups of the file, while I have the user and group identifiers from the following lines:
struct stat statBuf; statBuf.st_uid;
In the default command (ls) on Unix, file information is printed so that the username is displayed instead of the username.
Can someone help me find the right methodology to extract the username and group from their identifiers?
source share