With PCDEZIP you can confidently download files compressed with PKZIP, Version 2.0. BY BOB FLANDERS AND MICHAEL HOLMES Decompress files with PCDEZIP f you've been using PCUNZIP to PCDEZIP's syntax decompress files, it's time to upgrade to usage: PCDEZIP [switches] zipfile [target\1 [filespec 1...11 I the new PCDEZIP. Phil Katz has released Version 2.0 of his popular switches: -f freshen existing files shareware compression program, PKZIP, extract new and updated files do not prompt on overwrite and the old utility can't decompress the ZIP directory newly zipped files. The new PCDEZIP will -d create directories unzip files zipped with either version of -t test file integrity PKZIP. zipfile .ZIP file Although we have added some valuable new features to PCDEZIP, our attempt has target \ the target directory; trailing backslash required not been to duplicate all the capabilities of the commercial product. PCDEZIP does filenames are files to be extracted; wildcards supported not, for example, permit using wildcard Fig 1: When you enter PCDEZIP with no parameters, it displays its syntax and switches as shown here characters in the .ZIP filename, handle files that span more than one floppy disk, preserve read-only file attributes, or respectively. If you don't supply a compiler it. For example, if SOURCE.ZIP is in your decrypt encrypted files. To get these parameter, C.BAT assumes Borland C++ D :\ PROJECT directory, then the com- facilities — and, of course, to be able to zip 3.1. mand files yourself — you must obtain the full- scale PKZIP, which is available from My PCDEZIP D:\PROJECT\SOURCE Computer Company on (02) 565 1991. Our Using PCDEZIP aim here is simply to provide our readers The full command line syntax for PCDEZIP will expand SOURCE.ZIP and put its files with a no-cost way to .decompress MagDisk is into your current directory. files. You can select a different target direc- You can get a copy of PCDEZIP by PCDEZIP [switches] zipfile tory by using PCDEZIP's target\ option. To downloading PCDEZP.EXE from MagDisk, [target\] [filespec [. .]] specify a target directory, you type in the as explained in the sidebar 'How to obtain directory pathname as the argument direct- a copy of PCDEZIP'. Entered without any of its optional ly following the .ZIP file to be processed. After downloading, you should rename parameters, the command Note that the target argument must end the file PCDEZIP.EXE. To study or change with a backslash, because this is how the source code, download the self-extract- PCDEZIP zipfile PCDEZIP identifies it as a directory. Thus, ing archive file PCDZ.EXE. to put the decompressed contents of the After running PCDZ.EXE, you can use simply decompresses the contents of the SOURCE. ZIP file shown above into E: \JOB, the included C.BAT batch file to compile named .ZIP file and places them into your you would enter the program. The parameter you supply to current directory. You do not need to enter C.BAT specifies the compiler you're using. the .ZIP extension; PCDEZIP assumes it PCDEZIP D:\PROJECT\SOURCE E:\JOS\ To compile with Borland C++ 3.1, Borland unless you specify otherwise. Turbo C++ 3.0, or Microsoft C/C++ 7.0 (or If the .ZIP file is not in your current If the target directory you desire does later), use the parameters C B, C T, or C M, directory, you have to provide the path to not already exist, you can instruct PCDEZIP APC MARCH 1994 PAGE 203 The /0 switch tells PCDEZIP to overwrite any existing same-named files without regard for their date and without prompting for confirmation. Use this switch with care! You can test the integrity of a .ZIP file with the /T (test) switch. When you specify the test switch, PCDEZIP performs a com- plete decompression operation on each re- quested file but creates no output files. If an error is detected, PCDEZIP displays an error message next to the file that contains the error. You can view the contents of a .ZIP file without decompressing it by employing the /V switch. Frequently, your reason for wanting to use this switch is that you wish to unzip only one or two specific files from the .ZIP files. This is done by using PCDEZIP's filespec option. Suppose, for example, that you have a .ZIP file named DATA. ZIP in the root direc- tory and you enter the command PCDEZIP /V \DATA Figure 2 shows the hypothetical contents of this file in the same way that /V displays them. Notice that in this instance, the .ZIP file contains compressed files and direc- tory information too. Specifically, the IN- COME.DAT and INCOME.IDX files are prefaced with directory names, although INDEX.DAT stands alone. If your interest is in decompressing only INDEX.DAT, you would use the filespec argument to specify the file you wanted by entering the com- mand to create one for you, unless the .ZIP file when the switch is placed after zip_file. PCDEZIP \DATA INDEX.DAT already contains its own directory informa- Only the slash can be used if the switch tion. (ZIP files that do contain such infor- parameter follows the name of the file-to be Note that as shown in the syntax line mation are created with the -apr option of decompressed. above, the filespec argument may be used PKZIP and are considered below in the Three of the PCDEZIP switches, /F, /N, to specify more than one file. This option section, 'Restoring directories'). To do this, and /0, allow you to eliminate the utility's also supports the use of wildcards. you make use of the /D switch with the overwrite prompt. Before PCDEZIP target\ option. Assuming that SOURCE.ZIP decompresses a zipped file, it checks to see is an ordinary .ZIP file that contains no whether there is a same-named file in the Restoring directories stored directory information and that you destination directory. If so, PCDEZIP nor- When creating a .ZIP file, PKZIP can op- want to create the \JOB directory on drive mally displays the filename, the DOS direc- tionally store the pathname along with the E:, the command would be tory information for both files, and the filename. In Figure 2, PKZIP used the message, 'Overwrite existing file? directory tree seen in Figure 3 to put all the PCDEZIP /D D:\PROJECT\SOURCE (Y/n/all/stop)'. Press Y to replace the file, files in all of the subdirectories below the E:\JOB\ N to skip that file, A to overwrite both it and \ ACCT directory into \ DATA.ZIP. all subsequent files without further prompt- Preserving the directory structure stored The six optional switches that PCDEZIP ing, and S to stop the utility and return to in a .ZIP file while expanding its files is the supports are listed and briefly explained in DOS. other of the two jobs of PCDEZIP's /D Figure 1. This figure shows the help mes- The /F switch freshens existing files. It switch. To restore the contents and struc- sage that is displayed when you enter decompresses only those files that have an ture of the \ ACCT directory tree, you would PCDEZIP without any arguments. The older, same-named version in the destina- use the commands command line switch may actually be tion directory. When the /F is specified, any placed either before or after the zip_file same-named but earlier-dated files are auto- CD \ACCT entry. Like the command line switches of matically overwritten. The /N (newer) PCDEZIP /D \DATA other APC utilities, the switches for switch unzips the same files as /F but also PCDEZIP are identified by a slash CO. For adds any files that do not have a same- If the /D switch is specified when readers more accustomed to the syntax of named version in the destination directory. PCDEZIP searches through the .ZIP file, it the commercial PKUNZIP, a hyphen (-) Specifying this switch will not overwrite any creates any directories whose names have may be used in place of the slash, except later-dated, same-named files, however. been stored as part of the compressed files. PAGE 204 APC MARCH 1994 Thus, when PCDEZIP encounters 1991 \ IN- PCDEZIP /D \DATA 1992\*.* however, PCDEZIP will create only \DIR2, COME.DAT, it looks first to see whether the since that is what is needed to hold 1991 directory exists in the current ( \ ACCT) If you wanted to unzip all the files in only NOTES.TXT. The \DIR1 directory would directory. If not, PCDEZIP creates such a the 1991, 1992, and 1993 directories, how- not be created because INFO.DAT was not directory before restoring 1991 \ IN- ever, you might be tempted to use the unzipped from the .ZIP file. COME.DAT. command This would seem to preclude the crea- If you don't specify the /D switch, tion of empty directories, since PCDEZIP PCDEZIP will, by default, attempt to put PCDEZIP /D \DATA 199?\*.* never has a need to create them. You can, every file in \ DATA.ZIP into your current however, force PCDEZIP to create empty directory. This could be a problem. For This attempt would fail, however, because directories by using *.* as the filespec. example, if you issued the command you cannot specify a wildcard as part of a Moreover, if you do not specify a filespec subdirectory definition. Since PCDEZIP argument, PCDEZIP uses the s." specifica- PCDEZIP \DATA does not decode wildcards used in the tion by default. path portion of the filename arguments, it PCDEZIP will place INCOME.DAT and IN- will not match 199? with any of the direc- COME.IDX into the current directory by tories.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages5 Page
-
File Size-