I am implementing the (ls) command on Unix while learning from a book. During the coding part of my implementation of the (ls) command with
check my code for username:
#include #include #include string getUser(uid_t uid) { struct passwd *pws; pws = getpwuid(uid); return pws->pw_name; }
for groupname you can use getgrgid.