[PHP] RE: @file problems w/ remote files

2001-12-11 Thread Tim Ward

How about wrapping the @file(...); in an if(file_exists(...)) {...}

Doesn't seem to give an error at all , even without the @. I've tested this
on non-existant domain names and with my firewall internet connection
blocked.

Tim
http://www.chessish.com/ http://www.chessish.com/ 

--
From:  Joseph Fung [SMTP:[EMAIL PROTECTED]]
Sent:  11 December 2001 00:17
To:  PHP General Mailing List
Subject:  @file problems w/ remote files

Hi,

This is regarding the same problem that Jeff posted earlier (yes,
the exast
same problem - I'm working with him).  He seems to have given some
of you
the wrong impression about the problem - he is not ignoring your
posts, it's
just that the posts aren't helping the problem ;)

The problem is that the @ isn't suppressing the warnings properly.
Our code
is currently trying to pull the results of a script off a server -
and if it
can't, it uses the most current copy stored locally.  The problem,
is that
while we are expecting the @ to suppress the warnings (and thereby
letting
us continue on to use file() on the local copy), it is instead
allowing file
to spit out a warning which kills the script.

We are currently getting a errornum of 2, and it's spitting out
fopen(filename) - Success which is exceedingly annoying.

What would be perfect, is if someone knows of an alternate way to
download a
file from a server - if that failed, set a flag and continue
processing
rather than simply erroring out.

Thanks for any help - sorry for the miscommunication earlier.

Joseph


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RE: @file problems w/ remote files

2001-12-11 Thread Joseph Fung

Thanks Tim,

I had aready tried that and it didn't work either - go figure.

I did, however, manage to work around the problem by setting
error_reporting(0) before the operation, then returning error_reporting to
it's previous value, and continuing on my mery way.

Thanks for all the suggestions,

Joseph

-Original Message-
From: Tim Ward [mailto:[EMAIL PROTECTED]]
Sent: December 11, 2001 4:55 AM
To: PHP General Mailing List; Joseph Fung
Subject: [PHP] RE: @file problems w/ remote files


How about wrapping the @file(...); in an if(file_exists(...)) {...}

Doesn't seem to give an error at all , even without the @. I've tested this
on non-existant domain names and with my firewall internet connection
blocked.

Tim
http://www.chessish.com/ http://www.chessish.com/

Thanks for any help - sorry for the miscommunication earlier.

Joseph


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RE: @file problems w/ remote files

2001-12-11 Thread Darren Gamble

Good day,

I had not even noticed the @ character... and you are right, your original
setup should have supressed the message.

Most likely this is a bug; it would be worthwhile to post it on PHP's bug
list to prevent future pain and suffering for people doing the same thing.
=)

Question, though... if the host is resolvable, but the file does not exist,
does the function print an error (with the @ character)?


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Joseph Fung [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 11, 2001 6:24 AM
To: PHP General Mailing List
Subject: RE: [PHP] RE: @file problems w/ remote files


Thanks Tim,

I had aready tried that and it didn't work either - go figure.

I did, however, manage to work around the problem by setting
error_reporting(0) before the operation, then returning error_reporting to
it's previous value, and continuing on my mery way.

Thanks for all the suggestions,

Joseph

-Original Message-
From: Tim Ward [mailto:[EMAIL PROTECTED]]
Sent: December 11, 2001 4:55 AM
To: PHP General Mailing List; Joseph Fung
Subject: [PHP] RE: @file problems w/ remote files


How about wrapping the @file(...); in an if(file_exists(...)) {...}

Doesn't seem to give an error at all , even without the @. I've tested this
on non-existant domain names and with my firewall internet connection
blocked.

Tim
http://www.chessish.com/ http://www.chessish.com/

Thanks for any help - sorry for the miscommunication earlier.

Joseph


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]