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.


6
7
8
9
# File 'lib/vagrant/util/file_mode.rb', line 6

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