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
> 
> 
> 



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

Reply via email to