hoopycat wrote:
Hmm... when you chmod 777 it and let fopen() create the file, what user/group is applied to it?
The reason for the different behavior for create vs. write is that creating a file requires writing to the directory (which is itself just a "file"); once it's created, the directory doesn't need to be written to and life goes on.
Your explanation makes sense, and that's kind of how I expected the file system to work. When I leave the directory as 777 and let fopen create the file it's created as nginx:nginx
I specifically put nginx in my webc group so I was expecting a directory with ownership of webc:webc set to 775 would let nginx create files in it