Show
Ignore:
Timestamp:
04/28/08 15:58:53 (7 months ago)
Author:
charsbar
Message:

Archive-Lha: applied a patch from Yukio USUDA to fix level 1 header handling; added 'known limitation' section to note the slowness.

Location:
lang/perl/Archive-Lha/trunk
Files:
1 added
6 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Archive-Lha/trunk/Changes

    r3588 r10646  
    11Revision history for Archive-Lha 
     2 
     30.03 2008/04/28 
     4  - applied a patch from Yukio USUDA to fix level 1 header handling. 
     5  - added 'known limitation' section to note the slowness. 
    26 
    370.02 2007/12/26 
  • lang/perl/Archive-Lha/trunk/MANIFEST

    r3588 r10646  
    3333t/archive/lh0.lzh 
    3434t/archive/lh5.lzh 
     35t/archive/lh5_lvl1.lzh 
    3536t/archive/lh7.lzh 
    3637tools/plha 
  • lang/perl/Archive-Lha/trunk/lib/Archive/Lha.pm

    r3588 r10646  
    44use warnings; 
    55 
    6 our $VERSION = '0.02'; 
     6our $VERSION = '0.03'; 
    77 
    88require XSLoader; 
     
    4040 
    4141This package offers rather crude methods to decode/extract files from LHa archives. As of writing this, I'm not inclined to support creating/updating archives for various reasons but this may change. As for decoding, I'll probably add if testable (and preferably uploadable) archives should be found or offered. 
     42 
     43=head1 KNOWN LIMITATION 
     44 
     45As you suspect, this is slow. Really slow. Some of the code is written in XS/C, but it may take minutes to extract larger archives (well, I must confess, the prototype of this module, written in pure perl, took hours to extract them). If you need more speed, just use native archivers such as LHa for UNIX, or unlha32.dll for MSWin32. They have their own limitations (such as single-threadedness, may need temporary files, and others), but they're much faster, and would take seconds to extract. 
    4246 
    4347=head1 ACKNOWLEDGMENT 
  • lang/perl/Archive-Lha/trunk/lib/Archive/Lha/Header/Level0.pm

    r6751 r10646  
    6969This parses Level 0 headers found mainly in the oldest archives created in the MS-DOS era. Actually, it was designed for LHarc, one of the ancestors of LHa. 
    7070 
    71 As Level 0 header has rather severe limitation for the path length of the archived file, recent archivers usually use Level 2 (or extended Level 1) headers. If you find multibyte strings in the header, most probably they are encoded in shift_jis. 
     71As Level 0 header has rather severe limitation for the path length of the archived file, recent archivers usually use Level 2 (or extended Level 1) headers. If you find multibyte strings in the header, most probably they are encoded in shift-jis. 
    7272 
    7373=head1 METHODS 
  • lang/perl/Archive-Lha/trunk/lib/Archive/Lha/Header/Level1.pm

    r6751 r10646  
    5252  my $extended_size_total = 0; 
    5353  my $extended_size = _short( @bits[-2..-1] ); 
    54   my $from = $size; 
    5554  while( $extended_size ) { 
     55    @bits = split '', $stream->read( $extended_size ); 
    5656    $extended_size_total += $extended_size; 
    57     my $to = $from + $extended_size - 1; 
    58     my ($next, %hash) = _extended_header( @bits[$from..$to] ); 
     57    my ($next, %hash) = _extended_header( @bits ); 
    5958    %header = (%header, %hash) if %hash; 
    6059    $extended_size = $next; 
    61     $from = $to + 1; 
    6260  } 
    6361  $header{encoded_size} = $header{skip_size} - $extended_size_total; 
     
    8381This parses Level 1 headers found mainly in older archives created in the MS-DOS era. Also, some of the older ports, including LHa for UNIX, still prefer this header for compatibility reasons. Historically, Level 1 header, which is actually a combination of previous Level 0 header and following Level 2 header, was designed to foster the transition to Level 2 header. However, as Level 2 implementation delayed, Level 1 archives prevailed enough and could not be ignored. 
    8482 
    85 Level 1 header also has rather severe limitation for the path length of the archived file. However, Level 1 header can use extended headers to store longer file/directory names. Multibyte strings in the header may be encoded in shift_jis, or in euc-jp, or in other encodings. 
     83Level 1 header also has rather severe limitation for the path length of the archived file. However, Level 1 header can use extended headers to store longer file/directory names. Multibyte strings in the header may be encoded in shift-jis, or in euc-jp, or in other encodings. 
    8684 
    8785=head1 METHODS 
  • lang/perl/Archive-Lha/trunk/t/20_decode.t

    r3588 r10646  
    1111  test( file_stream( $name ) ); 
    1212} 
     13 
     14test( file_stream('lh5_lvl1') ); 
    1315 
    1416sub test {