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) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to