Class: Train::File::Remote::Qnx

Inherits:
Unix show all
Defined in:
lib/train/file/remote/qnx.rb

Constant Summary

Constants inherited from Train::File

DATA_FIELDS

Instance Method Summary collapse

Methods inherited from Unix

#content=, #exist?, #grouped_into?, #link_path, #linked_to?, #mode?, #mounted, #path, #sanitize_filename, #shallow_link_path, #unix_mode_mask

Methods inherited from Train::File::Remote

#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

#contentObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/train/file/remote/qnx.rb', line 11

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

#typeObject



22
23
24
25
26
27
28
# File 'lib/train/file/remote/qnx.rb', line 22

def type
  if @backend.run_command("file #{@spath}").stdout.include?("directory")
    :directory
  else
    :file
  end
end