Class: Train::File::Remote::Aix
- Inherits:
-
Unix
show all
- Defined in:
- lib/train/file/remote/aix.rb,
lib/train/file/remote/qnx.rb
Constant Summary
Constants inherited
from Train::File
DATA_FIELDS
Instance Attribute Summary
Attributes inherited from Unix
#path
Instance Method Summary
collapse
Methods inherited from Unix
#exist?, #grouped_into?, #linked_to?, #mode?, #sanitize_filename, #unix_mode_mask
#basename, #stat
Methods inherited from Train::File
#block_device?, #character_device?, #directory?, #file?, #file_version, #initialize, #md5sum, #mounted?, #owned_by?, #path, #pipe?, #product_version, #sanitize_filename, #sha256sum, #socket?, #source, #source_path, #symlink?, #to_json, #version?
Constructor Details
This class inherits a constructor from Train::File
Instance Method Details
#content ⇒ Object
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/train/file/remote/qnx.rb', line 12
def content
cat = 'cat'
cat = '/proc/boot/cat' if @backend.os[:release].to_i >= 7
@content ||= case
when !exist?
nil
else
@backend.run_command("#{cat} #{@spath}").stdout || ''
end
end
|
#link_path ⇒ Object
9
10
11
12
13
|
# File 'lib/train/file/remote/aix.rb', line 9
def link_path
return nil unless symlink?
@link_path ||=
@backend.run_command("perl -e 'print readlink shift' #{@spath}").stdout.chomp
end
|
#mounted ⇒ Object
15
16
17
|
# File 'lib/train/file/remote/aix.rb', line 15
def mounted
@mounted ||= @backend.run_command("lsfs -c #{@spath}")
end
|
#type ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/train/file/remote/qnx.rb', line 23
def type
if @backend.run_command("file #{@spath}").stdout.include?('directory')
return :directory
else
return :file
end
end
|