Simple example of a program checking file access permissions in C