Class: EC2::Platform::Linux::Mtab

Inherits:
Object
  • Object
show all
Defined in:
lib/ec2/platform/linux/mtab.rb

Direct Known Subclasses

Solaris::Mtab

Defined Under Namespace

Classes: Entry

Constant Summary collapse

LOCATION =
'/etc/mtab'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename = LOCATION) ⇒ Mtab

Returns a new instance of Mtab.



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/ec2/platform/linux/mtab.rb', line 55

def initialize(filename = LOCATION)
  begin
    f = File.new(filename, File::RDONLY)
  rescue SystemCallError => e
    raise FileError(filename, "could not open #{filename} to read mount table", e)
  end
  @entries = Hash.new
  f.readlines.each do |line|
    entry = Entry.parse(line)
    @entries[entry.mpoint] = entry unless entry.nil?
  end          
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



52
53
54
# File 'lib/ec2/platform/linux/mtab.rb', line 52

def entries
  @entries
end

Class Method Details

.loadObject



68
69
70
# File 'lib/ec2/platform/linux/mtab.rb', line 68

def self.load
  self.new()
end