Use mode_t in struct to grab file permissions.
Also fix up some minor layout issues and compile warning.
Merge pull request #5 from xsacha/master

Use mode_t in struct to grab file permissions.