Hey thanks for your reply. However i've not used awk or sed before and i'm not suppose to use it for this exercise. The full task is to use a file as an argument then display the permissions in a certain format like so :-
READ WRITE EXECUTE
OWNER LEE.BALLANCORE YES YES NO
GROUP USERS YES NO NO
EVERYBODY NO NO NO
i jus want to know how to read the permissions in binary so i can use if statements to create the text...if ya get me, sorry if it sounds a bit of a woffle
If I am not wrong, you are trying to achieve this with C code..correct me If I am wrong.
Check out this link..
http://www.gnu.org/software/libc/manual/html_node/Permission-Bits.html#Permission-Bits
Here are enough macros to read the permission for file.
If you are doing this under shell script..then no option other that 'awk'.