Class: LibMsPack::MsCab::MsCabdFile
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- LibMsPack::MsCab::MsCabdFile
- Defined in:
- lib/libmspack/mscab.rb
Overview
A structure which represents a single file in a cabinet or cabinet set.
Instance Method Summary collapse
-
#attribs ⇒ Fixnum
File attributes.
-
#datetime ⇒ Time
File's last modified datetime.
-
#filename ⇒ String
The filename of the file.
-
#folder ⇒ MsCabdFolder?
Folder that contains this file.
-
#length ⇒ Fixnum
The uncompressed length of the file, in bytes.
-
#next ⇒ MsCabdFile?
The next file in the cabinet or cabinet set, or nil if this is the final file.
-
#offset ⇒ Fixnum
The uncompressed offset of this file in its folder.
Instance Method Details
#attribs ⇒ Fixnum
File attributes.
The following attributes are defined:
- MSCAB_ATTRIB_RDONLY indicates the file is write protected.
- MSCAB_ATTRIB_HIDDEN indicates the file is hidden.
- MSCAB_ATTRIB_SYSTEM indicates the file is a operating system file.
- MSCAB_ATTRIB_ARCH indicates the file is "archived".
- MSCAB_ATTRIB_EXEC indicates the file is an executable program.
- MSCAB_ATTRIB_UTF_NAME indicates the filename is in UTF8 format rather than ISO-8859-1.
161 162 163 |
# File 'lib/libmspack/mscab.rb', line 161 def attribs self[:attribs] end |
#datetime ⇒ Time
File's last modified datetime.
168 169 170 |
# File 'lib/libmspack/mscab.rb', line 168 def datetime Time.gm(self[:date_y], self[:date_m], self[:date_d], self[:time_h], self[:time_m], self[:time_s]) end |
#filename ⇒ String
The filename of the file.
String of up to 255 bytes in length, it may be in either ISO-8859-1 or UTF8 format, depending on the file attributes.
138 139 140 |
# File 'lib/libmspack/mscab.rb', line 138 def filename self[:filename] end |
#folder ⇒ MsCabdFolder?
Folder that contains this file.
175 176 177 178 |
# File 'lib/libmspack/mscab.rb', line 175 def folder return nil if self[:folder].pointer.address.zero? self[:folder] end |
#length ⇒ Fixnum
The uncompressed length of the file, in bytes.
145 146 147 |
# File 'lib/libmspack/mscab.rb', line 145 def length self[:length] end |
#next ⇒ MsCabdFile?
The next file in the cabinet or cabinet set, or nil if this is the final file.
128 129 130 131 |
# File 'lib/libmspack/mscab.rb', line 128 def next return nil if self[:next].pointer.address.zero? self[:next] end |
#offset ⇒ Fixnum
The uncompressed offset of this file in its folder.
183 184 185 |
# File 'lib/libmspack/mscab.rb', line 183 def offset self[:offset] end |