Re: is_writable for a dir?
| From: | David T-G | Date: | Sat, 22 Feb 2003 16:49:09 +0000 |
| Subject: | Re: is_writable for a dir? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-136640@lists.php.net to get a copy of this message | ||
Michael --
..and then Michael Sims said...
%
% On Sat, 22 Feb 2003 07:23:20 -0500, you wrote:
%
% >How can I tell if a directory is writable? It seems that is_writable
% >only works on file, and the mode I get out of stat() is [in this case,
% >anyway] '16895' for a 0777 dir.
%
% The 16895 is in decimal. Use decoct() to convert it to octal and drop
% the leading digit (which seems to be 4 for directories):
Ahhh... I get it!
%
% $statInfo = stat('./testDir');
% $dirMode = substr(decoct($statInfo['mode']), 1);
Hey, lookit that... My mode is now 40777, just as I would figure :-)
Thanks!
The real problem still remains, however; if it's not writable for all,
then I need to see whether or not its writable, and preferably without
checking the making of a temp file or digging into UID/GID and group
membership and so on...
Thanks & TIA for more & HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!