Class: Vagrant::Util::FileMode

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant/util/file_mode.rb

Class Method Summary collapse

Class Method Details

.from_octal(octal) ⇒ Object

This returns the file permissions as a string from an octal number.



9
10
11
12
# File 'lib/vagrant/util/file_mode.rb', line 9

def self.from_octal(octal)
  perms = sprintf("%o", octal)
  perms.reverse[0..2].reverse
end