Forum Moderators: coopster

Message Too Old, No Replies

how to use chmod-ability to decide action

hey everyone, another Q from me

         

al1911

8:35 am on Jan 25, 2005 (gmt 0)

10+ Year Member



i want to do this...

if ( i can chmod folder ) {
chmod("folder", 0777) }
else {
echo "can't chmod folder"; }

what do i replace "i can chmod folder" with?
or is there a better way of doing this?
any help appreciated.

dmmh

8:51 am on Jan 25, 2005 (gmt 0)

10+ Year Member



if (!chmod("folder", 0777){
echo "can't chmod folder";
}

al1911

9:43 am on Jan 25, 2005 (gmt 0)

10+ Year Member



i tried that, i get the error message...

Warning: chmod(): Operation not permitted in /WebServer/Site/thingy.php on line 2

followed by the text to echo if it can't chmod

dmmh

10:04 am on Jan 25, 2005 (gmt 0)

10+ Year Member



sorry

if (!@chmod("folder", 0777){
echo "can't chmod folder";
}

al1911

10:11 am on Jan 25, 2005 (gmt 0)

10+ Year Member



ah, yes
i should have known that too :P
it works now

many thanks :)

dmmh

11:41 am on Jan 25, 2005 (gmt 0)

10+ Year Member



welcome :)