Class: Train::Extras::AixFile
- Inherits:
-
LinuxFile
- Object
- FileCommon
- LinuxFile
- Train::Extras::AixFile
- Defined in:
- lib/train/extras/aix_file.rb
Instance Attribute Summary
Attributes inherited from LinuxFile
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(backend, path) ⇒ AixFile
constructor
A new instance of AixFile.
- #link_path ⇒ Object
- #mounted ⇒ Object
Methods inherited from LinuxFile
#exist?, #file_version, #link_target, #product_version, #stat
Methods inherited from FileCommon
#block_device?, #character_device?, #directory?, #file?, #grouped_into?, #linked_to?, #md5sum, #mode?, #mounted?, #owned_by?, #pipe?, #sha256sum, #socket?, #symlink?, #type, #unix_mode_mask, #version?
Constructor Details
#initialize(backend, path) ⇒ AixFile
Returns a new instance of AixFile.
8 9 10 |
# File 'lib/train/extras/aix_file.rb', line 8 def initialize(backend, path) super(backend, path) end |
Instance Method Details
#content ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/train/extras/aix_file.rb', line 12 def content return @content if defined?(@content) @content = case when !exist?, directory? nil when size.nil?, size == 0 '' else @backend.run_command("cat #{@spath}").stdout || '' end end |
#link_path ⇒ Object
24 25 26 27 28 29 |
# File 'lib/train/extras/aix_file.rb', line 24 def link_path return nil unless symlink? @link_path ||= ( @backend.run_command("perl -e 'print readlink shift' #{@spath}").stdout.chomp ) end |
#mounted ⇒ Object
31 32 33 34 35 |
# File 'lib/train/extras/aix_file.rb', line 31 def mounted @mounted ||= ( @backend.run_command("lsfs -c #{@spath}") ) end |