I am doing this

$newpath = "./uploads/newdir/";
if (!is_dir($newpath)) mkdir($newpath, 0666);
$decperms = fileperms($newpath);
$octalperms = sprintf("%o",$decperms);
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,

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

Reply via email to