Class: Zip::ZipFileSystem::ZipFsFile::ZipFsStat

Inherits:
Object
  • Object
show all
Defined in:
lib/zip/zipfilesystem.rb

Overview

protected :dir

Instance Method Summary collapse

Constructor Details

#initialize(zipFsFile, entryName) ⇒ ZipFsStat

Returns a new instance of ZipFsStat.


28
29
30
31
# File 'lib/zip/zipfilesystem.rb', line 28

def initialize(zipFsFile, entryName)
  @zipFsFile = zipFsFile
  @entryName = entryName
end

Instance Method Details

#blksizeObject


99
# File 'lib/zip/zipfilesystem.rb', line 99

def blksize; nil; end

#blocksObject


52
# File 'lib/zip/zipfilesystem.rb', line 52

def blocks; nil; end

#devObject


79
# File 'lib/zip/zipfilesystem.rb', line 79

def dev; 0; end

#forward_invoke(msg) ⇒ Object


33
34
35
# File 'lib/zip/zipfilesystem.rb', line 33

def forward_invoke(msg)
  @zipFsFile.send(msg, @entryName)
end

#ftypeObject


87
88
89
90
91
92
93
94
95
# File 'lib/zip/zipfilesystem.rb', line 87

def ftype
  if file?
    return "file"
  elsif directory?
    return "directory"
  else
    raise StandardError, "Unknown file type"
  end
end

#gidObject


59
60
61
62
63
64
65
66
# File 'lib/zip/zipfilesystem.rb', line 59

def gid
  e = get_entry
  if e.extra.member? "IUnix"
    e.extra["IUnix"].gid || 0
  else
    0
  end
end

#inoObject


77
# File 'lib/zip/zipfilesystem.rb', line 77

def ino; 0; end

#kind_of?(t) ⇒ Boolean

Returns:

  • (Boolean)

37
38
39
# File 'lib/zip/zipfilesystem.rb', line 37

def kind_of?(t)
  super || t == ::File::Stat 
end

#modeObject


101
102
103
104
105
106
107
108
# File 'lib/zip/zipfilesystem.rb', line 101

def mode
  e = get_entry
  if e.fstype == 3
    e.externalFileAttributes >> 16
  else
    33206 # 33206 is equivalent to -rw-rw-rw-
  end
end

97
# File 'lib/zip/zipfilesystem.rb', line 97

def nlink; 1; end

#rdevObject


81
# File 'lib/zip/zipfilesystem.rb', line 81

def rdev; 0; end

#rdev_majorObject


83
# File 'lib/zip/zipfilesystem.rb', line 83

def rdev_major; 0; end

#rdev_minorObject


85
# File 'lib/zip/zipfilesystem.rb', line 85

def rdev_minor; 0; end

#uidObject


68
69
70
71
72
73
74
75
# File 'lib/zip/zipfilesystem.rb', line 68

def uid
  e = get_entry
  if e.extra.member? "IUnix"
    e.extra["IUnix"].uid || 0
  else
    0
  end
end