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 is a Ruby extension library for unpacking LHarchived file.




!!!source code repositry



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


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

require 'lhalib'
# simpl extraction

*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'

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


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.


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

!!Japanese page