[Moscow.pm] zip- IO::Compress::Zip

Oleg Alistratov ali ali.org.ua
2 06:53:25 PDT 2013


,    ?  , 

02.10.2013, 15:49, "Mons Anderson" <mons  cpan.org>:
>  , 
>
> unzip -v
> perl -MIO::Compress::Zip -E 'say $IO::Compress::Zip::VERSION;'
> locale
>
>    7z  7za
>
> On 02.10.2013, at 15:30, Oleg Alistratov <ali  ali.org.ua> wrote:
>
>>    IO::Compress::Zlib (   Archive::Zip).
>>       7zip. ,      ,
>>    unzip-      :
>>
>> [15:26:18] local:~/enigmas/zip-rus% unzip -l result.zip
>> Archive: result.zip
>> Length Date Time Name
>> -------- ---- ---- ----
>> 8 10-02-13 15:25  .txt
>> -------- -------
>> 8 1 file
>>
>>     ,   zip  ,      
>>     members.        .
>>  , 7zip      cp866,    .
>>
>> 02.10.2013, 13:55, "" <monk  nuked.su>:
>>>  .
>>>
>>>    -      zip- 
>>>     Σ.      linux.
>>>  IO::Compress::Zlib .       ,
>>>   .
>>>
>>>    (  utf-8),     
>>>  .     ,   7z 
>>>    .
>>>
>>> cat pack.pl | sed '2,$s/^ *#.*//'
>>> #!/usr/bin/perl
>>>
>>> use strict;
>>> use warnings;
>>>
>>> use Encode;
>>>
>>> use IO::Compress::Zip qw(zip $ZipError) ;
>>>
>>> my $filename = ' .txt';
>>>
>>> my $z = new IO::Compress::Zip 'result.zip', { name=> $filename,
>>> CanonicalName => 1}
>>> or die "zip failed: $ZipError\n";
>>>
>>> $z->print("Content\n");
>>>
>>> $z->close;
>>>
>>>          utf-
>>>   .    decode,  
>>> .
>>> cat pack.pl | sed '2,$s/^ *#.*//'
>>> #!/usr/bin/perl
>>>
>>> use strict;
>>> use warnings;
>>>
>>> use Encode;
>>>
>>> use IO::Compress::Zip qw(zip $ZipError) ;
>>>
>>> my $filename = ' .txt';
>>> $filename = decode('utf8', $filename );
>>>
>>> my $z = new IO::Compress::Zip 'result.zip', { name=> $filename,
>>> CanonicalName => 1}
>>> or die "zip failed: $ZipError\n";
>>>
>>> $z->print("Content\n");
>>>
>>> $z->close;
>>>
>>>    7z    
>>> 7z l result.zip
>>>
>>> 7-Zip 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
>>> p7zip Version 9.20 (locale=en_US.utf8,Utf16=on,HugeFiles=on,4 CPUs)
>>>
>>> Listing archive: result.zip
>>>
>>> --
>>> Path = result.zip
>>> Type = zip
>>> Physical Size = 174
>>>
>>> Date Time Attr Size Compressed Name
>>> ------------------- ----- ------------ ------------ ------------------------
>>>  2013-10-02 14:48:14 .....            8           10  Ñ€ÑƒÑÑÐºÐ¾Ðµ
>>>  Ð¸Ð¼Ñ.txt
>>> ------------------- ----- ------------ ------------ ------------------------
>>> 8 10 1 files, 0 folders
>>>
>>> --
>>> Moscow.pm mailing list
>>> moscow-pm  pm.org | http://moscow.pm.org
>> --
>> Oleg Alistratov
>> --
>> Moscow.pm mailing list
>> moscow-pm  pm.org | http://moscow.pm.org
>
> --
> Moscow.pm mailing list
> moscow-pm  pm.org | http://moscow.pm.org

-- 
Oleg Alistratov


Moscow-pm