⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 archive::zip.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 4 页
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings.  \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote.  \*(C+ will.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\.    ds -- \(*W-.    ds PI pi.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch.    ds L" "".    ds R" "".    ds C` "".    ds C' ""'br\}.el\{\.    ds -- \|\(em\|.    ds PI \(*p.    ds L" ``.    ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el       .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD.  Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\.    de IX.    tm Index:\\$1\t\\n%\t"\\$2"...    nr % 0.    rr F.\}.el \{\.    de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear.  Run.  Save yourself.  No user-serviceable parts..    \" fudge factors for nroff and troff.if n \{\.    ds #H 0.    ds #V .8m.    ds #F .3m.    ds #[ \f1.    ds #] \fP.\}.if t \{\.    ds #H ((1u-(\\\\n(.fu%2u))*.13m).    ds #V .6m.    ds #F 0.    ds #[ \&.    ds #] \&.\}.    \" simple accents for nroff and troff.if n \{\.    ds ' \&.    ds ` \&.    ds ^ \&.    ds , \&.    ds ~ ~.    ds /.\}.if t \{\.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u".    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}.    \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E.    \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'.    \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\.    ds : e.    ds 8 ss.    ds o a.    ds d- d\h'-1'\(ga.    ds D- D\h'-1'\(hy.    ds th \o'bp'.    ds Th \o'LP'.    ds ae ae.    ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "Archive::Zip 3".TH Archive::Zip 3 "2007-11-07" "perl v5.10.0" "User Contributed Perl Documentation".\" For nroff, turn off justification.  Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"Archive::Zip \- Provide an interface to ZIP archive files..SH "SYNOPSIS".IX Header "SYNOPSIS".Vb 3\&   # Create a Zip file\&   use Archive::Zip qw( :ERROR_CODES :CONSTANTS );\&   my $zip = Archive::Zip\->new();\&   \&   # Add a directory\&   my $dir_member = $zip\->addDirectory( \*(Aqdirname/\*(Aq );\&   \&   # Add a file from a string with compression\&   my $string_member = $zip\->addString( \*(AqThis is a test\*(Aq, \*(AqstringMember.txt\*(Aq );\&   $string_member\->desiredCompressionMethod( COMPRESSION_DEFLATED );\&   \&   # Add a file from disk\&   my $file_member = $zip\->addFile( \*(Aqxyz.pl\*(Aq, \*(AqAnotherName.pl\*(Aq );\&   \&   # Save the Zip file\&   unless ( $zip\->writeToFileNamed(\*(AqsomeZip.zip\*(Aq) == AZ_OK ) {\&       die \*(Aqwrite error\*(Aq;\&   }\&   \&   # Read a Zip file\&   my $somezip = Archive::Zip\->new();\&   unless ( $somezip\->read( \*(AqsomeZip.zip\*(Aq ) == AZ_OK ) {\&       die \*(Aqread error\*(Aq;\&   }\&   \&   # Change the compression type for a file in the Zip\&   my $member = $somezip\->memberNamed( \*(AqstringMember.txt\*(Aq );\&   $member\->desiredCompressionMethod( COMPRESSION_STORED );\&   unless ( $zip\->writeToFileNamed( \*(AqsomeOtherZip.zip\*(Aq ) == AZ_OK ) {\&       die \*(Aqwrite error\*(Aq;\&   }.Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"The Archive::Zip module allows a Perl program to create, manipulate, read,and write Zip archive files..PPZip archives can be created, or you can read from existing zip files..PPOnce created, they can be written to files, streams, or strings. Memberscan be added, removed, extracted, replaced, rearranged, and enumerated.They can also be renamed or have their dates, comments, or other attributesqueried or modified. Their data can be compressed or uncompressed as needed..PPMembers can be created from members in existing Zip files, or from existingdirectories, files, or strings..PPThis module uses the Compress::Zlib library to read and write thecompressed streams inside the files..Sh "File Naming".IX Subsection "File Naming"Regardless of what your local file system uses for file naming, names in aZip file are in Unix format (\fIforward\fR slashes (/) separating directorynames, etc.)..PP\&\f(CW\*(C`Archive::Zip\*(C'\fR tries to be consistent with file naming conventions, and willtranslate back and forth between native and Zip file names..PPHowever, it can't guess which format names are in. So two rules control whatkind of file name you must pass various routines:.IP "Names of files are in local format." 4.IX Item "Names of files are in local format."\&\f(CW\*(C`File::Spec\*(C'\fR and \f(CW\*(C`File::Basename\*(C'\fR are used for various fileoperations. When you're referring to a file on your system, use itsfile naming conventions..IP "Names of archive members are in Unix format." 4.IX Item "Names of archive members are in Unix format."This applies to every method that refers to an archive member, orprovides a name for new archive members. The \f(CW\*(C`extract()\*(C'\fR methodsthat can take one or two names will convert from local to zip namesif you call them with a single name..Sh "Archive::Zip Object Model".IX Subsection "Archive::Zip Object Model".Sh "Overview".IX Subsection "Overview"Archive::Zip::Archive objects are what you ordinarily deal with.These maintain the structure of a zip file, without necessarilyholding data. When a zip is read from a disk file, the (possiblycompressed) data still lives in the file, not in memory. Archivemembers hold information about the individual members, but not(usually) the actual member data. When the zip is written to a(different) file, the member data is compressed or copied as needed.It is possible to make archive members whose data is held in a stringin memory, but this is not done when a zip file is read. Directorymembers don't have any data..Sh "Inheritance".IX Subsection "Inheritance".Vb 9\&  Exporter\&   Archive::Zip                            Common base class, has defs.\&       Archive::Zip::Archive               A Zip archive.\&       Archive::Zip::Member                Abstract superclass for all members.\&           Archive::Zip::StringMember      Member made from a string\&           Archive::Zip::FileMember        Member made from an external file\&               Archive::Zip::ZipFileMember Member that lives in a zip file\&               Archive::Zip::NewFileMember Member whose data is in a file\&           Archive::Zip::DirectoryMember   Member that is a directory.Ve.SH "EXPORTS".IX Header "EXPORTS".IP ":CONSTANTS" 4.IX Item ":CONSTANTS"Exports the following constants:.Sp\&\s-1FA_MSDOS\s0 \s-1FA_UNIX\s0 \s-1GPBF_ENCRYPTED_MASK\s0\&\s-1GPBF_DEFLATING_COMPRESSION_MASK\s0 \s-1GPBF_HAS_DATA_DESCRIPTOR_MASK\s0\&\s-1COMPRESSION_STORED\s0 \s-1COMPRESSION_DEFLATED\s0 \s-1IFA_TEXT_FILE_MASK\s0\&\s-1IFA_TEXT_FILE\s0 \s-1IFA_BINARY_FILE\s0 \s-1COMPRESSION_LEVEL_NONE\s0\&\s-1COMPRESSION_LEVEL_DEFAULT\s0 \s-1COMPRESSION_LEVEL_FASTEST\s0\&\s-1COMPRESSION_LEVEL_BEST_COMPRESSION\s0.IP ":MISC_CONSTANTS" 4.IX Item ":MISC_CONSTANTS"Exports the following constants (only necessary for extending themodule):.Sp\&\s-1FA_AMIGA\s0 \s-1FA_VAX_VMS\s0 \s-1FA_VM_CMS\s0 \s-1FA_ATARI_ST\s0 \s-1FA_OS2_HPFS\s0\&\s-1FA_MACINTOSH\s0 \s-1FA_Z_SYSTEM\s0 \s-1FA_CPM\s0 \s-1FA_WINDOWS_NTFS\s0\&\s-1GPBF_IMPLODING_8K_SLIDING_DICTIONARY_MASK\s0\&\s-1GPBF_IMPLODING_3_SHANNON_FANO_TREES_MASK\s0\&\s-1GPBF_IS_COMPRESSED_PATCHED_DATA_MASK\s0 \s-1COMPRESSION_SHRUNK\s0\&\s-1DEFLATING_COMPRESSION_NORMAL\s0 \s-1DEFLATING_COMPRESSION_MAXIMUM\s0\&\s-1DEFLATING_COMPRESSION_FAST\s0 \s-1DEFLATING_COMPRESSION_SUPER_FAST\s0\&\s-1COMPRESSION_REDUCED_1\s0 \s-1COMPRESSION_REDUCED_2\s0 \s-1COMPRESSION_REDUCED_3\s0\&\s-1COMPRESSION_REDUCED_4\s0 \s-1COMPRESSION_IMPLODED\s0 \s-1COMPRESSION_TOKENIZED\s0\&\s-1COMPRESSION_DEFLATED_ENHANCED\s0\&\s-1COMPRESSION_PKWARE_DATA_COMPRESSION_LIBRARY_IMPLODED\s0.IP ":ERROR_CODES" 4.IX Item ":ERROR_CODES"Explained below. Returned from most methods..Sp\&\s-1AZ_OK\s0 \s-1AZ_STREAM_END\s0 \s-1AZ_ERROR\s0 \s-1AZ_FORMAT_ERROR\s0 \s-1AZ_IO_ERROR\s0.SH "ERROR CODES".IX Header "ERROR CODES"Many of the methods in Archive::Zip return error codes. These are implementedas inline subroutines, using the \f(CW\*(C`use constant\*(C'\fR pragma. They can be importedinto your namespace using the \f(CW\*(C`:ERROR_CODES\*(C'\fR tag:.PP.Vb 1\&  use Archive::Zip qw( :ERROR_CODES );\&  \&  ...\&  \&  unless ( $zip\->read( \*(Aqmyfile.zip\*(Aq ) == AZ_OK ) {\&      die "whoops!";\&  }.Ve.IP "\s-1AZ_OK\s0 (0)" 4.IX Item "AZ_OK (0)"Everything is fine..IP "\s-1AZ_STREAM_END\s0 (1)" 4.IX Item "AZ_STREAM_END (1)"The read stream (or central directory) ended normally..IP "\s-1AZ_ERROR\s0 (2)" 4.IX Item "AZ_ERROR (2)"There was some generic kind of error..IP "\s-1AZ_FORMAT_ERROR\s0 (3)" 4.IX Item "AZ_FORMAT_ERROR (3)"There is a format error in a \s-1ZIP\s0 file being read..IP "\s-1AZ_IO_ERROR\s0 (4)" 4.IX Item "AZ_IO_ERROR (4)"There was an \s-1IO\s0 error..Sh "Compression".IX Subsection "Compression"Archive::Zip allows each member of a \s-1ZIP\s0 file to be compressed (using theDeflate algorithm) or uncompressed..PPOther compression algorithms that some versions of \s-1ZIP\s0 have been able toproduce are not supported. Each member has two compression methods: theone it's stored as (this is always \s-1COMPRESSION_STORED\s0 for string and externalfile members), and the one you desire for the member in the zip file..PPThese can be different, of course, so you can make a zip member that is notcompressed out of one that is, and vice versa..PPYou can inquire about the current compression and set the desiredcompression method:.PP.Vb 2\&  my $member = $zip\->memberNamed( \*(Aqxyz.txt\*(Aq );\&  $member\->compressionMethod();    # return current compression\&  \&  # set to read uncompressed\&  $member\->desiredCompressionMethod( COMPRESSION_STORED );\&  \&  # set to read compressed\&  $member\->desiredCompressionMethod( COMPRESSION_DEFLATED );.Ve.PPThere are two different compression methods:.IP "\s-1COMPRESSION_STORED\s0" 4.IX Item "COMPRESSION_STORED"File is stored (no compression).IP "\s-1COMPRESSION_DEFLATED\s0" 4.IX Item "COMPRESSION_DEFLATED"File is Deflated.Sh "Compression Levels".IX Subsection "Compression Levels"If a member's desiredCompressionMethod is \s-1COMPRESSION_DEFLATED\s0, youcan choose different compression levels. This choice may affect thespeed of compression and decompression, as well as the size of thecompressed member data..PP.Vb 1\&  $member\->desiredCompressionLevel( 9 );.Ve.PPThe levels given can be:.IP "0 or \s-1COMPRESSION_LEVEL_NONE\s0" 4.IX Item "0 or COMPRESSION_LEVEL_NONE"This is the same as saying.Sp.Vb 1\&  $member\->desiredCompressionMethod( COMPRESSION_STORED );.Ve.IP "1 .. 9" 4.IX Item "1 .. 9"1 gives the best speed and worst compression, and 9 gives thebest compression and worst speed..IP "\s-1COMPRESSION_LEVEL_FASTEST\s0" 4.IX Item "COMPRESSION_LEVEL_FASTEST"This is a synonym for level 1..IP "\s-1COMPRESSION_LEVEL_BEST_COMPRESSION\s0" 4.IX Item "COMPRESSION_LEVEL_BEST_COMPRESSION"This is a synonym for level 9..IP "\s-1COMPRESSION_LEVEL_DEFAULT\s0" 4.IX Item "COMPRESSION_LEVEL_DEFAULT"This gives a good compromise between speed and compression,and is currently equivalent to 6 (this is in the zlib code).This is the level that will be used if not specified..SH "Archive::Zip Methods".IX Header "Archive::Zip Methods"The Archive::Zip class (and its invisible subclass Archive::Zip::Archive)implement generic zip file functionality. Creating a new Archive::Zip object

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -