/* a sample program that creats a file named "temp" 
with special attribues. */
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>

int main() {
    int fd;
    
    /* read, write, execute permission: owner 
       read, write permission: group 
       read, write permission: other */
    if((fd = creat("temp",S_IRWXU|         
                      S_IRGRP|S_IXGRP| 
                      S_IROTH|S_IXOTH)) == -1){
      printf("cannot creat a file\n");
      exit(1);
    } 
    else
       printf("File 'temp' has been created.\n");
}
