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

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

Overview

protected :dir

Instance Method Summary collapse

Constructor Details

#initialize(zipFsFile, entryName) ⇒ ZipFsStat

Returns a new instance of ZipFsStat.



73
74
75
76
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 73

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

Instance Method Details

#blksizeObject



144
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 144

def blksize; nil; end

#blocksObject



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

def blocks; nil; end

#devObject



124
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 124

def dev; 0; end

#forward_invoke(msg) ⇒ Object



78
79
80
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 78

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

#ftypeObject



132
133
134
135
136
137
138
139
140
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 132

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

#gidObject



104
105
106
107
108
109
110
111
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 104

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

#inoObject



122
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 122

def ino; 0; end

#kind_of?(t) ⇒ Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 82

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

#modeObject



146
147
148
149
150
151
152
153
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 146

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


142
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 142

def nlink; 1; end

#rdevObject



126
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 126

def rdev; 0; end

#rdev_majorObject



128
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 128

def rdev_major; 0; end

#rdev_minorObject



130
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 130

def rdev_minor; 0; end

#uidObject



113
114
115
116
117
118
119
120
# File 'lib/ruby_archive/handlers/rubyzip/zip/zipfilesystem.rb', line 113

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