Create  Edit  Diff  FrontPage  Index  Search  Changes  Login

The Backyard - LhaLibEn Diff

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

!LhaLib

!!Summary

LhaLib is a Ruby extension library for unpacking LHarchived file.

!!Download

!!!packages

http://www.artonx.org/data/lhalibhttps://www.artonx.org/data/lhalib

!!!!gems

http://www.artonx.org/data/lhalib/lhalib-0.8.1.gemhttps://www.artonx.org/data/lhalib/lhalib-0.8.1.gem

http://www.artonx.org/data/lhalib/lhalib-0.8.1-mswin32.gemhttps://www.artonx.org/data/lhalib/lhalib-0.8.1-mswin32.gem

!!!source code repositry

https://github.com/arton/lhalib

!!Licence

[[LGPL|http://www.gnu.org/licenses/lgpl.html]]

This product is forked from LHa for Unix under the distribution condition number 6.

!!Usage

LhaLib is a ruby module, that only contains one method named 'x'.

require 'lhalib'
# simpl extraction
LhaLib::x('lharchive.lzh')

*retrun value: number of extracted files.

require 'lhalib'
# fetching the information about extracted file or directory
LhaLib::x('lharchive.lzh') do |info|
   puts "name=#{info[:name]}"
   puts "filesize=#{info[:original_size]}"
   puts "timestamp=#{info[:stamp]}"
   puts "permission=#{info[:permission] & 0777}"
   if (info[:permission] & 040000) != 0
     puts 'directory'
   end
end

*retrun value: number of extracted files.
*block: called by LhaLib after extracting a file or directry.
*blck parameter: Hash of the header information.

!!Notice

The thread safety of Ruby is broken with a block parameter.
If you need to keep the Ruby level thread safety, call the method without block parameter.

!!Thanks

I thanks for the original LHa effort by Mr. Tagawa, Mr. Oki, Mr. Watazaki et al.

!!Japanese page
LhaLib