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.
88 89 90 91 |
# File 'lib/zip/filesystem.rb', line 88 def initialize(zipFsFile, entryName) @zipFsFile = zipFsFile @entryName = entryName end |
Class Method Details
.delegate_to_fs_file(*methods) ⇒ Object
76 77 78 79 80 81 82 83 84 |
# File 'lib/zip/filesystem.rb', line 76 def delegate_to_fs_file(*methods) methods.each do |method| self.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
149 |
# File 'lib/zip/filesystem.rb', line 149 def blksize; nil; end |
#blocks ⇒ Object
102 |
# File 'lib/zip/filesystem.rb', line 102 def blocks; nil; end |
#dev ⇒ Object
129 |
# File 'lib/zip/filesystem.rb', line 129 def dev; 0; end |
#ftype ⇒ Object
137 138 139 140 141 142 143 144 145 |
# File 'lib/zip/filesystem.rb', line 137 def ftype if file? return "file" elsif directory? return "directory" else raise StandardError, "Unknown file type" end end |
#gid ⇒ Object
109 110 111 112 113 114 115 116 |
# File 'lib/zip/filesystem.rb', line 109 def gid e = get_entry if e.extra.member? "IUnix" e.extra["IUnix"].gid || 0 else 0 end end |
#ino ⇒ Object
127 |
# File 'lib/zip/filesystem.rb', line 127 def ino; 0; end |
#kind_of?(t) ⇒ Boolean
93 94 95 |
# File 'lib/zip/filesystem.rb', line 93 def kind_of?(t) super || t == ::File::Stat end |
#mode ⇒ Object
151 152 153 154 155 156 157 158 |
# File 'lib/zip/filesystem.rb', line 151 def mode e = get_entry if e.fstype == 3 e.external_file_attributes >> 16 else 33206 # 33206 is equivalent to -rw-rw-rw- end end |
#nlink ⇒ Object
147 |
# File 'lib/zip/filesystem.rb', line 147 def nlink; 1; end |
#rdev ⇒ Object
131 |
# File 'lib/zip/filesystem.rb', line 131 def rdev; 0; end |
#rdev_major ⇒ Object
133 |
# File 'lib/zip/filesystem.rb', line 133 def rdev_major; 0; end |
#rdev_minor ⇒ Object
135 |
# File 'lib/zip/filesystem.rb', line 135 def rdev_minor; 0; end |
#uid ⇒ Object
118 119 120 121 122 123 124 125 |
# File 'lib/zip/filesystem.rb', line 118 def uid e = get_entry if e.extra.member? "IUnix" e.extra["IUnix"].uid || 0 else 0 end end |