Class: Zip::FileSystem::ZipFsFile::ZipFsStat
- Inherits:
-
Object
- Object
- Zip::FileSystem::ZipFsFile::ZipFsStat
- Defined in:
- lib/zip/filesystem.rb
Overview
protected :dir
Class Method Summary collapse
Instance Method Summary collapse
- #blksize ⇒ Object
- #blocks ⇒ Object
- #dev ⇒ Object
- #ftype ⇒ Object
- #gid ⇒ Object
-
#initialize(zipFsFile, entryName) ⇒ ZipFsStat
constructor
A new instance of ZipFsStat.
- #ino ⇒ Object
- #kind_of?(t) ⇒ Boolean
- #mode ⇒ Object
- #nlink ⇒ Object
- #rdev ⇒ Object
- #rdev_major ⇒ Object
- #rdev_minor ⇒ Object
- #uid ⇒ Object
Constructor Details
#initialize(zipFsFile, entryName) ⇒ ZipFsStat
Returns a new instance of ZipFsStat.
82 83 84 85 |
# File 'lib/zip/filesystem.rb', line 82 def initialize(zipFsFile, entryName) @zipFsFile = zipFsFile @entryName = entryName end |
Class Method Details
.delegate_to_fs_file(*methods) ⇒ Object
71 72 73 74 75 76 77 78 79 |
# File 'lib/zip/filesystem.rb', line 71 def delegate_to_fs_file(*methods) methods.each do |method| class_eval <<-end_eval, __FILE__, __LINE__ + 1 def #{method} # def file? @zipFsFile.#{method}(@entryName) # @zipFsFile.file?(@entryName) end # end end_eval end end |
Instance Method Details
#blksize ⇒ Object
157 158 159 |
# File 'lib/zip/filesystem.rb', line 157 def blksize nil end |
#blocks ⇒ Object
96 97 98 |
# File 'lib/zip/filesystem.rb', line 96 def blocks nil end |
#dev ⇒ Object
127 128 129 |
# File 'lib/zip/filesystem.rb', line 127 def dev 0 end |
#ftype ⇒ Object
143 144 145 146 147 148 149 150 151 |
# File 'lib/zip/filesystem.rb', line 143 def ftype if file? return 'file' elsif directory? return 'directory' else raise StandardError, 'Unknown file type' end end |
#gid ⇒ Object
105 106 107 108 109 110 111 112 |
# File 'lib/zip/filesystem.rb', line 105 def gid e = get_entry if e.extra.member? 'IUnix' e.extra['IUnix'].gid || 0 else 0 end end |
#ino ⇒ Object
123 124 125 |
# File 'lib/zip/filesystem.rb', line 123 def ino 0 end |
#kind_of?(t) ⇒ Boolean
87 88 89 |
# File 'lib/zip/filesystem.rb', line 87 def kind_of?(t) super || t == ::File::Stat end |
#mode ⇒ Object
161 162 163 164 165 166 167 168 |
# File 'lib/zip/filesystem.rb', line 161 def mode e = get_entry if e.fstype == 3 e.external_file_attributes >> 16 else 33_206 # 33206 is equivalent to -rw-rw-rw- end end |
#nlink ⇒ Object
153 154 155 |
# File 'lib/zip/filesystem.rb', line 153 def nlink 1 end |
#rdev ⇒ Object
131 132 133 |
# File 'lib/zip/filesystem.rb', line 131 def rdev 0 end |
#rdev_major ⇒ Object
135 136 137 |
# File 'lib/zip/filesystem.rb', line 135 def rdev_major 0 end |
#rdev_minor ⇒ Object
139 140 141 |
# File 'lib/zip/filesystem.rb', line 139 def rdev_minor 0 end |
#uid ⇒ Object
114 115 116 117 118 119 120 121 |
# File 'lib/zip/filesystem.rb', line 114 def uid e = get_entry if e.extra.member? 'IUnix' e.extra['IUnix'].uid || 0 else 0 end end |