Re: Can someone explain this please...
| From: | Bogdan Stancescu | Date: | Fri, 16 Aug 2002 00:58:15 +0000 |
| Subject: | Re: Can someone explain this please... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112889@lists.php.net to get a copy of this message | ||
Hummm, sorry, you're right, you're converting it do a "fake" octal via strings, I was wrong in my first paragraph. In any case, if it helps, on my comp it really does evaluate true.
Bogdan
Gandalf wrote:
Hello! I am doing this $newpath = "./uploads/newdir/"; if (!is_dir($newpath)) mkdir($newpath, 0666); $decperms = fileperms($newpath); $octalperms = sprintf("%o",$decperms); $perms=(substr($octalperms,2)); echo $perms; if ($perms != 777) { rmdir ($newpath); } This will not delete the dir created with $newpath. It will only work if i change this if ($perms != 777) into this if ($perms != '777' ) // Please note the single quotes around 777 Could someone tell me why it behaves like this? Cause if for example i do this $foo = 1; if ($foo == 1) //will evaluate as true, so why not with the above? Thanks a lot in advance for your time and help! Best regards from Vienna, Jürgen