class Asar::Reader
- Asar::Reader
- Reference
- Object
Overview
Enables reading of files from the given archive with #get, #get_bytes and #read_raw.
Files are cached automatically when using #get or #get_bytes; data is stored inside a Hash.
Please make sure that you have enough memory.
Note: When reading from the archive, you have to use absolute paths.
The top level directory of the asar archive is the root. e.g.: /hello.txt. Paths are case-sensitive.
Defined in:
asar/reader.crConstructors
-
.new(path : String)
Creates a new
Readerfor the given archive file.
Instance Method Summary
-
#files
Returns an
Array(String)that contains all files (absolute paths) that are in the archive. -
#files_cached
Returns an
Array(String)of all files in the cache. -
#get(path : String) : IO::Memory
Returns an
IO::Memorycreated from the cached file. -
#get_bytes(path : String) : Bytes
Returns the cached file.
- #header : Header
- #header=(header : Header)
- #io : ::File
- #io=(io : ::File)
-
#read_raw(path : String) : Bytes
Reads directly from the files
IO, bypassing the cache.
Constructor Detail
Instance Method Detail
Returns an Array(String) that contains all files (absolute paths) that are in the archive.