note 87613 deleted from function.fileperms by danbrown

From: Date: Fri, 12 Dec 2008 19:31:49 +0000
Subject: note 87613 deleted from function.fileperms by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-148095@lists.php.net to get a copy of this message
Note Submitter: remy dot damour at nospamthankyou dot laposte dot net ---- to @Martin: In fact decoct does not always return a 6-digit long int (or 6-char long string), therefore function calls you indicated do not always work (ex: decoct() returned "40755" => substr("40755", 3) returned "55" where "755" was expected). Instead I used: (minus sign used on second parameter) <?php substr(decoct(fileperms("test.html")),-3); // Displays 666 or 777 (depends on chmod set) substr(decoct(fileperms("test.html")),-4); // Displays 0666 or 0777 and refers immediately to the number set with chmod(); ?> Thx, Remy

« previous php.notes (#148095) next »