I am trying to write a small C program that emulates the unix command
ls -l. To do so, I am using the stat(2) syscall and have ran into a small hiccup writing the permissions. I have a mode_t variable which holds the file permissions from st_mode, and it wouldn’t be hard to parse that value into s string representation, but I was just wondering if there is a better way to be doing it than that.
I am trying to write a small C program that emulates the unix command
Share
example from google
result: