Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created April 7, 2014 20:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save practicingruby/10046168 to your computer and use it in GitHub Desktop.
Save practicingruby/10046168 to your computer and use it in GitHub Desktop.
MODES = { "0" => "---",
"1" => "--x",
"2" => "-w-",
"3" => "-wx",
"4" => "r--",
"5" => "r-x",
"6" => "rw-",
"7" => "rwx" }
def permissions(num)
num.to_s(8).chars.map { |n| MODES[n] }.join
end
p permissions(0640)
p permissions(0644)
p permissions(0777)
@Favorwilliams
Copy link

My Pleasure to write you,
My name is Favor Williams,
My email address is
( Favor24@live.com)
Am interested to know
more about you,
Contact me for my
photo and other
important issue via,

Favor24@live.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment