• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

fileperms decoct gives wrong value

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
peter2001
Asked:
peter2001
  • 3
1 Solution
 
AlexSoftware EngineerCommented:
try to read this manual maybe will help you.


http://php.oregonstate.edu/manual/en/function.fileperms.php
0
 
AlexSoftware EngineerCommented:
or try to trim the string and cut the first 3 chars.

substr(decoct(fileperms($yourfile)),-3);
0
 
AlexSoftware EngineerCommented:
0
 
peter2001Author Commented:
thanks
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now