I am writing a simple code about opening a file with O_CREAT | O_WDONLY | O_EXCL flags. The code looks like this:
int fd = open(fileName, O_WRONLY | O_CREAT | O_EXCL, 0777); It works well, except for the mode (permission) part. What ever I put in the others part, it always creates a file with r-x.
For example, the permission of the file created from the above code looks like this.
rwxrwxr-x. This isn't 777 isn't it ? What am I missing ?