class Aruba::Platforms::FilesystemStatus
File System Status object
This is a wrapper for File::Stat returning only a subset of information.
Constants
- METHODS
Attributes
status[R]
Public Class Methods
new(path)
click to toggle source
# File lib/aruba/platforms/filesystem_status.rb, line 31 def initialize(path) @status = File::Stat.new(path) end
Public Instance Methods
group()
click to toggle source
Return owning group
# File lib/aruba/platforms/filesystem_status.rb, line 46 def group status.gid end
mode()
click to toggle source
Return permissions
# File lib/aruba/platforms/filesystem_status.rb, line 36 def mode format("%o", status.mode)[-4,4].gsub(/^0*/, '') end
owner()
click to toggle source
Return owner
# File lib/aruba/platforms/filesystem_status.rb, line 41 def owner status.uid end
to_h()
click to toggle source
Convert status to hash
@return [Hash]
A hash of values
# File lib/aruba/platforms/filesystem_status.rb, line 54 def to_h { :owner => owner, :group => group, :mode => mode, :executable => executable?, :ctime => ctime, :atime => atime, :mtime => mtime, :size => size } end