Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

fileperms decoct gives wrong value

Posted on 2007-11-26
4
Medium Priority
?
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
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.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

715 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