File: aix.rb

package info (click to toggle)
ruby-train 3.2.28-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,116 kB
  • sloc: ruby: 9,246; sh: 17; makefile: 8
file content (29 lines) | stat: -rw-r--r-- 648 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# encoding: utf-8

require_relative "unix"

module Train
  class File
    class Remote
      class Aix < Train::File::Remote::Unix
        def link_path
          return nil unless symlink?

          @link_path ||=
            @backend.run_command("perl -e 'print readlink shift' #{@spath}").stdout.chomp
        end

        def shallow_link_path
          return nil unless symlink?

          @shallow_link_path ||=
            @backend.run_command("perl -e 'print readlink shift' #{@spath}").stdout.chomp
        end

        def mounted
          @mounted ||= @backend.run_command("lsfs -c #{@spath}")
        end
      end
    end
  end
end