When I open a file using fopen($filename, 'w+')
(that is, reading and writing), it creates the file with permissions like this:
-rw-r--r-- 1 www-data www-data 0 2010-12-09 12:02 TransactionImport-7.txt
Then, when other processes try to open the file, they can't do it. How can I get the file to open with less strict permissions?
I can't change the permissions after I close the file because other programs need to read the file while it's still being written. When I try to change them before with chmod()
, it makes it so my script can't write to the file at all.