Re: file checking
| From: | Greg Gatlin | Date: | Fri, 23 Jun 2000 18:57:29 +0000 |
| Subject: | Re: file checking | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2850@lists.php.net to get a copy of this message | ||
>
Try putting a "@" sign in front of fopen. ie. @fopen("blah");
It will suppress the warning.
Have Fun.
> Here's my code:
>
> $fp = fopen(
>
> "http://media.gospelcom.net/mnn/news/2000/06/44-5min-23-06-2000.mp3",
> "r");
>
> if ($fp) {
> print "It's there";
> } else {
> print "It's not there";
> }
>
> If the file exists, it works fine, but if it *doesn't* exist, it prints
> this:
>
> Warning:
>
> fopen("http://media.gospelcom.net/mnn/news/2000/06/44-5min-23-06-2000.mp3","r")
> - Success in /usr/local/www/gospelcom/docs/mnn/mnn/beta/remotetest.php on
> line 5
> It's not there
>
> Why is it printing that Warning?
>
> I tried is_file and is_readable, and both return that the file isn't not
> there, regardless of whether it is. :(
>
> --
> Topher
> Manager of Internet Services
> Cornerstone Communications
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net