Sagewire Logo

file_exists, is_readable & effective UID/GID

4 Message(s) by 3 Author(s) originally posted in php general


From: manuel.vacelet Date:   Wednesday, October 24, 2007
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 isn't an option because it raises an E_WARNING if the file
isn't readable.

Thanks,
Manuel


From: parasane Date:   Wednesday, October 24, 2007
wrote in message:
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 isn't an option because it raises an E_WARNING if the file
isn't readable.
Thanks,
Manuel
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


That's what you've things like <? ini_set("display_errors", "off"); ?>

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Give a man a fish, he will eat for a day. Then you will find out he was
allergic and is hospitalized. See? No good deed goes unpunished....


From: lists Date:   Wednesday, October 24, 2007
wrote in message:
wrote in message:
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 isn't an option because it raises an E_WARNING if the file
isn't readable.

Thanks,
Manuel

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


That's what you've things like <? ini_set("display_errors", "off"); ?>



what about doing it like this?

<?php

$filename = __FILE__;

$stat_info = @xxxxxxxxxxx($filename);

if ( $stat_info ) {
// do something...
}

The '@xxxxxxxxxxx' will suppress the E_WARNING notice
if stat fails the condition will fail.

--
Jim Lucas

"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare


From: manuel.vacelet Date:   Thursday, October 25, 2007
wrote in message:
wrote in message:
wrote in message:
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 isn't an option because it raises an E_WARNING if the file
isn't readable.
Thanks,
Manuel
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
>
> That's what you've things like <? ini_set("display_errors", "off"); ?>
>
what about doing it like this?
<?php
$filename = __FILE__;
$stat_info = @xxxxxxxxxxx($filename);
if ( $stat_info ) {
// do something...
}
The '@xxxxxxxxxxx' 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



Next Message: FINDER



Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional