I write just for fun a little utility to help to translate from octal to string and vice versa*nix file permissions.With this utility you can also drop a file , change permissions and apply back to the file.Full source+executableYou can learn the use of unix permission, extends, regex, and the permission object.Feel free to download it from here: http://www.eudosia.com/downloads/download.php?download=53

You could also consider working with shift and bitwise and to get the bits. so you wont need a full array, only a "r","w","x" array.The trick would be to loop over all bits (shift & bitwise and to get the bit's value).If the bit is a 0, then the position is a "-", else set the char to array(position mod 3).After that loop, search for sticky bits and set them accordingly.

EDIT: A small example with sticky bits and what i meant with the advice above. Converts a oct (766) to alpha (rwxr--r--) with support for sticky bits.