I have a program to write that outputs the file permissions for each file in a directory but I cant figure out how to get the right format for it. It has to ouput it in the format like 755 or 644 or whatever but the st_mode in the stat structure has all those extra information in it but all I need is those last 3 digits. So how do you get rid of all the extra digits?