Re: file_exists, is_readable & effective UID/GID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/24/07, Jim Lucas <lists@xxxxxxxxx> wrote:
> Daniel Brown wrote:
> > On 10/24/07, Manuel Vacelet <manuel.vacelet@xxxxxxxxx> wrote:
> >> Hi all,
> >>
> >> file_exists and is_readable perfom there test with real UID/GID.
> >> Is there any functions that tests file existance with effective UID/GID ?
> >>
> >> Note: stat is not an option because it raises an E_WARNING if the file
> >> is not readable.
> >>
> >> Thanks,
> >> Manuel
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >     That's what you have things like <? ini_set("display_errors", "off"); ?>
> >
>
> what about doing it like this?
>
> <?php
>
> $filename = __FILE__;
>
> $stat_info = @stat($filename);
>
> if ( $stat_info ) {
>         // do something...
> }
>
> The '@' will suppress the E_WARNING notice
> if stat fails the condition will fail.

I much prefer the second solution  (Jim's one) even if I find that php
limitation amazing !

Thank you for your help.
Cheers,
Manuel

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux