My original plan was to pipe "ls -l", get the permission string that represented the file in question. Translate the string of 'r's 'w's 'x's '-'s into 0s and 1s then convert it from binary to octal.

This seems really cumbersome and annoying and I gotta figure there is some faster way. Even getting a string representation of the octal value would be great. I'm working in C on a linux environment btw.

Ideas?

Thanks!