Re: Problems with files!!!!!
| From: | Jon Jacob | Date: | Mon, 02 Apr 2001 04:11:58 +0000 |
| Subject: | Re: Problems with files!!!!! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46552@lists.php.net to get a copy of this message | ||
Tyrone Mills wrote:
> I don't know if it's been mentioned or not, but I have found that unless the
> file exists, I can't open it. Have you verified that the file exists and the
> user that the script will run as has the appropriate permissions?
>
>
I think you are mistaken. According to the PHP manual page, with fopen the
option 'w' does the following:
"Open for writing only; place the file pointer at the beginning of the file and
truncate the file to zero length. If the file does not exist, attempt to create
it. "
In this case the line:
$fp = fopen("tmp/some.dat", "w"); // trying to open file in my
Would create the file if it did not exist, but you make a good point that
permissions need to be set. The directory would need to probably be world
writable (usually 755 or xrw-rw-rw).
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com