Sha256: 9ed99dfaed0078c55dc08d79ca27671e92b048ce8356d57f0fa367aa1a8b06b5

Contents?: true

Size: 793 Bytes

Versions: 21

Compression:

Stored size: 793 Bytes

Contents

# -*- coding: binary -*-

#
# Create a zip file with comments!
#

msfbase = __FILE__
while File.symlink?(msfbase)
  msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
inc = File.dirname(msfbase) + '/../../..'
$:.unshift(inc)

require 'rex/zip'

# example usage
zip = Rex::Zip::Archive.new
zip.add_file("elite.txt", "A" * 1024, nil, %Q<
                                 +---------------+
                                 | file comment! |
                                 +---------------+
>)
zip.set_comment(%Q<

+------------------------------------------+
|                                          |
| Hello!  This is the Zip Archive comment! |
|                                          |
+------------------------------------------+

>)
zip.save_to("lolz.zip")

Version data entries

21 entries across 21 versions & 4 rubygems

Version Path
rex-zip-0.1.5 lib/rex/zip/samples/comment.rb
rex-zip-0.1.4 lib/rex/zip/samples/comment.rb
rex-2.0.13 lib/rex/zip/samples/comment.rb
rex-2.0.12 lib/rex/zip/samples/comment.rb
rex-2.0.11 lib/rex/zip/samples/comment.rb
rex-zip-0.1.3 lib/rex/zip/samples/comment.rb
rex-zip-0.1.2 lib/rex/zip/samples/comment.rb
rex-zip-0.1.1 lib/rex/zip/samples/comment.rb
rex-zip-0.1.0 lib/rex/zip/samples/comment.rb
rex-2.0.10 lib/rex/zip/samples/comment.rb
rex-2.0.9 lib/rex/zip/samples/comment.rb
rex-2.0.8 lib/rex/zip/samples/comment.rb
rex-2.0.7 lib/rex/zip/samples/comment.rb
rex-2.0.5 lib/rex/zip/samples/comment.rb
rex-2.0.4 lib/rex/zip/samples/comment.rb
dstruct-0.0.1 lib/rex/zip/samples/comment.rb
rex-2.0.3 lib/rex/zip/samples/comment.rb
librex-0.0.999 lib/rex/zip/samples/comment.rb
rex-2.0.2 lib/rex/zip/samples/comment.rb
librex-0.0.71 lib/rex/zip/samples/comment.rb