C File Permission Conversion

See Unix File Permissions...at least the beginning where I show how the mode is stored.

Your value of 100600 is two pieces of data. The last 4 digits tell you that the file has the same permissions as could be achieved via "chmod 600 file". So you need to isolate those 4 digits and throw away that leading 10. That is what the code is doing.