class Zip::FileSource
- Zip::FileSource
- Zip::Source
- Reference
- Object
Overview
Use file as a source for an Archive#add
or Archive#replace
.
Example
# create file source
source = FileSource.new(zip, "/path/to/file.txt")
# add file to archive as "foo.txt"
zip.add("foo.txt", source)
Defined in:
zip/sources.crConstructors
-
.new(archive : Archive, fname : String, offset : UInt64 = 0_u64, len : Int64 = -1)
Create file source for an
Archive#add
orArchive#replace
.
Instance methods inherited from class Zip::Source
to_unsafe : LibZip::ZipSourceT
to_unsafe
Constructor Detail
Create file source for an Archive#add
or Archive#replace
.
Raises an exception if FileSource
could not be created.
Example
# create file source
source = FileSource.new(zip, "/path/to/file.txt")
# add file to archive as "foo.txt"
zip.add("foo.txt", source)