I study programming. I am trying to make my own program look like the ls command , but with fewer options. What I am doing is taking the input name of the directory / file as an argument, and then getting the whole entry in the directory using dirent struct (if it's a directory).
After that I use stat () to take all the information about the file, but here is my problem when I use write () to print these values ββin order, but when I want to print them using printf (), I get a warning: format '% ld expects type' long int, but argument 2 is of type '__uid_t. I do not know what to use in place of % ld , as well as for other special data types.
source share