dir.c octal to string conversion seperated into a function