RE: [PHP] Re: Not a Valid File-Handle Resource
| From: | Dave [Hawk-Systems] | Date: | Tue, 30 Jul 2002 12:23:53 +0000 |
| Subject: | RE: [PHP] Re: Not a Valid File-Handle Resource | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110342@lists.php.net to get a copy of this message | ||
>> $dataFile =
>> @fopen("/home/blurredv/data/".$username."Contact.txt","w");
>> fputs($dataFile, $line);
>> fclose ($dataFile);
>>
>> These are the errors:
>>
>> Warning: Supplied argument is not a valid File-Handle resource in
>> /home/blurredv/public_html/redcarbon/update.php on line 34
>> Warning: Supplied argument is not a valid File-Handle resource in
>> /home/blurredv/public_html/redcarbon/update.php on line 35
>>
>> Note: My script work perfectly with different path names under Windows
>> NT. Do I have to do something special for Unix.
>>
>> Thanks in advance,
>
>At a guess, the value you are using as a filename is incorrect, but you are
>suppressing any error message from fopen - better that you test that result
>and be prepared to handle an error situation.
>
>For a further guess, the value $username doesn't have a trailing slash.
or moving to Unix introduced case sensitivity which windows has a habit of
ignoring (or correcting for you).
Cheers,
Dave