I'm using the open system call to both create and open a file in the following manner:
fileID = open("aFile", O_CREAT|O_RDWR|O_TRUNC);
I expect the file to be created with read and write permissions, and sometimes it is, but only times when I run ls -l
I see just w, or just r, or just x, or ws, or rwx, etc. If I run my program with the system call 3 times, I may get 3 different file permissions set for aFile
each time. I don't know what could be causing the problem since it seems to be being set randomly. Any ideas as to what may be the cause?