class Dle::Filesystem::Node

Attributes

fs[R]
path[R]

Public Class Methods

new(fs, path) click to toggle source
# File lib/dle/filesystem/node.rb, line 6
def initialize fs, path
  @fs = fs
  @path = path
  @path = @path.encode('UTF-8','UTF-8-MAC') if RUBY_PLATFORM.downcase["darwin"]
end

Public Instance Methods

group() click to toggle source
# File lib/dle/filesystem/node.rb, line 28
def group
  Etc.getgrgid(stat.gid).name
end
inode() click to toggle source
# File lib/dle/filesystem/node.rb, line 32
def inode
  "#{stat.dev.to_s(36)}-#{stat.ino.to_s(36)}"
end
mode() click to toggle source
# File lib/dle/filesystem/node.rb, line 16
def mode
  sprintf("%o", stat.mode).to_s[-3..-1]
end
owner() click to toggle source
# File lib/dle/filesystem/node.rb, line 24
def owner
  Etc.getpwuid(stat.uid).name
end
owngrp() click to toggle source
# File lib/dle/filesystem/node.rb, line 20
def owngrp
  "#{owner}:#{group}"
end
relative_path() click to toggle source
# File lib/dle/filesystem/node.rb, line 12
def relative_path
  @fs.relative_path(@path)
end