RE: Error Reporting for file commands

This is a discussion on RE: Error Reporting for file commands within the PHP General forums, part of the PHP Programming Forums category; Sometime ago, I posted the email below, regarding some problems with a file manager we have developed for our users. ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-25-2006
James Nunnerley
 
Posts: n/a
Default RE: Error Reporting for file commands

Sometime ago, I posted the email below, regarding some problems with a file
manager we have developed for our users.

The problem still exists, and is now starting to cause "complaints". Mainly
from my manager, who's fed-up with receiving the error emails from the
system, but it must be annoying users!

The scenario is; we have a fairly large Linux cluster, with a RAID disc.
Obviously because of the number of disc calls, there's a fair amount of
caching.

We think the problem is related to this, and would ideally like purely to
suppress the error, as it's normally when the script is trying to delete
something already deleted.

I've tried turning off errors (error_reporting(0)) and indeed using @ on all
php file system calls, but it still triggers an error.

Does anyone know of any issues with suppressing errors on the following
functions?
- unlink
- mkdir
- copy
- scandir

All of these fail sporadically, even with the above error stuff turned off,
and trigger an error.

Anyone's thoughts gratefully received....

Thanks
Nunners

-----Original Message-----
From: James Nunnerley [mailto:webmaster@webit.co.uk]
Sent: 25 July 2006 16:33
To: 'php-general@lists.php.net'
Subject: Error Reporting for file commands

We've created a file manager which allows users to access their web space on
a server. It's working brilliantly, except that it would seem there are
some caching issues, either by the system cache or the web server cache that
are causing us a headache.

When the script tries to delete a file, we always check (using file_exists)
to see whether the file exists before it's deleted.

The check comes back true, but the unlink then fails, saying no file or
directory there!

We've tried turning off all errors (using error_reoprting(0) ) but this
would seem to have little difference in the error - it still comes back with
a failure.

We are using our own error handling, but before the command is carried out,
there is this 0 call...

Does anyone know how we can stop these errors?

Cheers
Nunners
Reply With Quote
  #2 (permalink)  
Old 09-25-2006
Robert Cummings
 
Posts: n/a
Default Re: [PHP] RE: Error Reporting for file commands

On Mon, 2006-09-25 at 11:53 +0100, James Nunnerley wrote:
> Sometime ago, I posted the email below, regarding some problems with a file
> manager we have developed for our users.
>
> The problem still exists, and is now starting to cause "complaints". Mainly
> from my manager, who's fed-up with receiving the error emails from the
> system, but it must be annoying users!
>
> The scenario is; we have a fairly large Linux cluster, with a RAID disc.
> Obviously because of the number of disc calls, there's a fair amount of
> caching.
>
> We think the problem is related to this, and would ideally like purely to
> suppress the error, as it's normally when the script is trying to delete
> something already deleted.
>
> I've tried turning off errors (error_reporting(0)) and indeed using @ on all
> php file system calls, but it still triggers an error.
>
> Does anyone know of any issues with suppressing errors on the following
> functions?
> - unlink
> - mkdir
> - copy
> - scandir
>
> All of these fail sporadically, even with the above error stuff turned off,
> and trigger an error.
>
> Anyone's thoughts gratefully received....


Are you using a custom error handler? If so your error handler has to
properly handle errors that are incoming with the supression operator
enabled.

You can detect suppression for any given error by checking if
error_reporting() is set to 0.

Cheers,
Rob.
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
Reply With Quote
  #3 (permalink)  
Old 09-26-2006
Richard Lynch
 
Posts: n/a
Default Re: [PHP] RE: Error Reporting for file commands

Try using http://php.net/set_error_handler and see if you can trap the
errors.

You'll want to test it with a test script that intentionally causes
the errors.

On Mon, September 25, 2006 5:53 am, James Nunnerley wrote:
> Sometime ago, I posted the email below, regarding some problems with a
> file
> manager we have developed for our users.
>
> The problem still exists, and is now starting to cause "complaints".
> Mainly
> from my manager, who's fed-up with receiving the error emails from the
> system, but it must be annoying users!
>
> The scenario is; we have a fairly large Linux cluster, with a RAID
> disc.
> Obviously because of the number of disc calls, there's a fair amount
> of
> caching.
>
> We think the problem is related to this, and would ideally like purely
> to
> suppress the error, as it's normally when the script is trying to
> delete
> something already deleted.
>
> I've tried turning off errors (error_reporting(0)) and indeed using @
> on all
> php file system calls, but it still triggers an error.
>
> Does anyone know of any issues with suppressing errors on the
> following
> functions?
> - unlink
> - mkdir
> - copy
> - scandir
>
> All of these fail sporadically, even with the above error stuff turned
> off,
> and trigger an error.
>
> Anyone's thoughts gratefully received....
>
> Thanks
> Nunners
>
> -----Original Message-----
> From: James Nunnerley [mailto:webmaster@webit.co.uk]
> Sent: 25 July 2006 16:33
> To: 'php-general@lists.php.net'
> Subject: Error Reporting for file commands
>
> We've created a file manager which allows users to access their web
> space on
> a server. It's working brilliantly, except that it would seem there
> are
> some caching issues, either by the system cache or the web server
> cache that
> are causing us a headache.
>
> When the script tries to delete a file, we always check (using
> file_exists)
> to see whether the file exists before it's deleted.
>
> The check comes back true, but the unlink then fails, saying no file
> or
> directory there!
>
> We've tried turning off all errors (using error_reoprting(0) ) but
> this
> would seem to have little difference in the error - it still comes
> back with
> a failure.
>
> We are using our own error handling, but before the command is carried
> out,
> there is this 0 call...
>
> Does anyone know how we can stop these errors?
>
> Cheers
> Nunners
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Like Music?
http://l-i-e.com/artists.htm
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:32 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0