Last active
August 29, 2015 14:17
-
-
Save ybur-yug/299c0b379a6c361f1b0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
include FileUtils | |
# U G O | |
# rwxrwxrwx | |
0b111101101 | |
perms = 0b111101101 | |
perms.to_s(8) | |
#=> 755 | |
chmod perms 'somefile' | |
# and now youre absolutely sure on permissions without extra thought | |
# Or if you get back random perms and want to check them easily: | |
0755.to_s(2) | |
#=> "111101101" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment