Hi,
I am trying to find the permissions on a file, using mode method of
File:Stat.
Code :
s = File.stat(file_name)
p s.mode
For a file having 777 permissions, this prints : 16895
Any Idea on what does this number imply ?
Thanks,
Vikram
Hi,
I am trying to find the permissions on a file, using mode method of
File:Stat.
Code :
s = File.stat(file_name)
p s.mode
For a file having 777 permissions, this prints : 16895
Any Idea on what does this number imply ?
Thanks,
Vikram
Tim H. wrote:
Vikram Sharma wrote:
For a file having 777 permissions, this prints : 16895
Any Idea on what does this number imply ?
Thanks,
VikramPermissions are typically specified as octal numbers. 16895 is decimal.
“%o” % 16895 # -> 40777
Oh Yes ! Thanks a lot…
Cheers,
Vikram
Vikram Sharma wrote:
For a file having 777 permissions, this prints : 16895
Any Idea on what does this number imply ?
Thanks,
Vikram
Permissions are typically specified as octal numbers. 16895 is decimal.
“%o” % 16895 # -> 40777
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs