Solved

fileperms decoct gives wrong value

Posted on 2007-11-26
4
216 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_code
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_code
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_code earned 50 total points
ID: 20358468
0
 
LVL 1

Author Closing Comment

by:peter2001
ID: 31441381
thanks
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Make check boxes work 8 46
Special characters in a TCPDF 4 27
How do I fix this error with quotation marks? 4 26
JSON decode 5 20
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

726 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