Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

fileperms decoct gives wrong value

Posted on 2007-11-26
4
Medium Priority
?
232 Views
Last Modified: 2013-12-13
hi

am stuck when tring to find the chmod value of a file its giving me a strange number

this is the code am using

echo decoct(fileperms($baseDir . '/' . myfile.php') ) ;     //this is set to 644  octal is 1204
which gives me 100644

then when i try to take away the 10000 to leave 644 it gives me this 55224

heres the code i use

echo decoct(fileperms($baseDir . '/' . myfile.php')- 10000 ) ;  

any ideas why its not showing 644 when i take the 10000 away?

regards pete









0
Comment
Question by:peter2001
  • 3
4 Comments
 
LVL 9

Expert Comment

by:Alex
ID: 20358414
try to read this manual maybe will help you.


http://php.oregonstate.edu/manual/en/function.fileperms.php
0
 
LVL 9

Expert Comment

by:Alex
ID: 20358444
or try to trim the string and cut the first 3 chars.

substr(decoct(fileperms($yourfile)),-3);
0
 
LVL 9

Accepted Solution

by:
Alex earned 200 total points
ID: 20358468
0
 
LVL 1

Author Closing Comment

by:peter2001
ID: 31441381
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question