1 2ZOO(1) REFERENCE MANUAL ZOO(1) 3 4NAME 5 zoo - manipulate archives of files in compressed form 6 7SYNOPSIS 8 zoo {acfDeghHlLPTuUvVx}[aAcCdEfghImMnNoOpPqSu1:/.@n+-=] 9 archive [file] ... 10 zoo -command archive [file] ... 11 zoo h 12 13DESCRIPTION 14 Zoo is used to create and maintain collections of files in 15 compressed form. It uses a Lempel-Ziv compression algorithm 16 that gives space savings in the range of 20% to 80% depend- 17 ing on the type of file data. Zoo can store and selectively 18 extract multiple generations of the same file. Data can be 19 recovered from damaged archives by skipping the damaged por- 20 tion and locating undamaged data with the help of fiz(1). 21 22 This documentation is for version 2.1. Changes from previ- 23 ous versions are described in the section labelled CHANGES. 24 25 The command zoo h gives a summary of commands. Extended 26 multiscreen help can be obtained with zoo H. 27 28 Zoo will not add an archive to itself, nor add the archive's 29 backup (with .bak extension to the filename) to the archive. 30 31 Zoo has two types of commands: Expert commands, which con- 32 sist of one command letter followed by zero or more modifier 33 characters, and Novice commands, which consist of a hyphen 34 (`-') followed by a command word that may be abbreviated. 35 Expert commands are case-sensitive but Novice commands are 36 not. 37 38 When zoo adds a file to an existing archive, the default 39 action is to maintain one generation of each file in an 40 archive and to mark any older generation as deleted. A 41 limit on the number of generations to save can be specified 42 by the user for an entire archive, or for each file indivi- 43 dually, or both. Zoo deletes a stored copy of an added file 44 if necessary to prevent the number of stored generations 45 from exceeding the user-specified limit. 46 47 Deleted files may be later undeleted. Archives may be 48 packed to recover space occupied by deleted files. 49 50 All commands assume that the archive name ends with the 51 characters .zoo unless a different extension is supplied. 52 53 Novice commands 54 55 Novice commands may be abbreviated to a hyphen followed by 56 at least one command character. Each Novice command works 57 in two stages. First, the command does its intended work. 58 Then, if the result was that one or more files were deleted 59 in the specified archive, the archive is packed. If packing 60 occurs, the original unpacked archive is always left behind 61 with an extension of .bak. 62 63 No Novice command ever stores the directory prefix of a 64 file. 65 66 The Novice commands are as follows. 67 68 -add Adds the specified files to the archive. 69 70 -freshen 71 Adds a specified file to the archive if and only if an 72 older file by the same name already exists in the 73 archive. 74 75 -delete 76 Deletes the specified files from the archive. 77 78 -update 79 Adds a specified file to the archive either: if an 80 older file by the same name already exists in the 81 archive or: if a file by the same name does not 82 already exist in the archive. 83 84 -extract 85 Extracts the specified files from the archive. If no 86 file is specified all files are extracted. 87 88 -move 89 Equivalent to -add except that source files are deleted 90 after addition. 91 92 -print 93 Equivalent to -extract except that extracted data are 94 sent to standard output. 95 96 -list 97 Gives information about the specified archived files 98 including any attached comments. If no files are 99 specified all files are listed. Deleted files are not 100 listed. 101 102 -test 103 Equivalent to -extract except that the extracted data 104 are not saved but any errors encountered are reported. 105 106 -comment 107 Allows the user to add or update comments attached to 108 archived files. When prompted, the user may: type a 109 carriage return to skip the file, leaving any current 110 comment unchanged; or type a (possibly null) comment 111 of up to 32,767 characters terminated by /end (case- 112 insensitive) on a separate line; or type the end-of- 113 file character (normally control D) to skip all remain- 114 ing files. 115 116 -delete 117 Deletes the specified files. 118 119 The correspondence between Novice and Expert commands is as follows. 120 121 Novice Equivalent 122 Command Description Expert Command 123 ____________________________________________________________ 124 -add add files to archive ahP 125 -extract extract files from archive x 126 -move move files to archive ahMP 127 -test test archive integrity xNd 128 -print extract files to standard output xp 129 -delete delete files from archive DP 130 -list list archive contents Vm 131 -update add new or newer files ahunP 132 -freshen by add newer files ahuP 133 -comment add comments to files c 134 135 Expert commands 136 137 The general format of expert commands is: 138 139 zoo {acfDeghHlLPTuUvVx}[aAcCdEfghImMnNoOpPqSu1:/.@n+-=] 140 archive [file] ... 141 142 The characters enclosed within {} are commands. Choose any 143 one of these. The characters enclosed within [] just to the 144 right of the {} are modifiers and zero or more of these may 145 immediately follow the command character. All combinations 146 of command and modifier characters may not be valid. 147 148 Files are added to an archive with the command: 149 150 zoo {au}[cfhIMnPqu:+-] archive [file] ... 151 152 Command characters are: 153 154 a Add each specified file to archive. Any already- 155 archived copy of the file is deleted if this is neces- 156 sary to avoid exceeding the user-specified limit on the 157 number of generations of the file to maintain in the 158 archive. 159 160 u Do an update of the archive. A specified file is added 161 to the archive only if a copy of it is already in the 162 archive and the copy being added is newer than the copy 163 already in the archive. 164 165 The following modifiers are specific to these commands. 166 167 M Move files to archive. This makes zoo delete (unlink) 168 the original files after they have been added to the 169 archive. Files are deleted after addition of all files 170 to the archive is complete and after any requested 171 packing of the archive has been done, and only if zoo 172 detected no errors. 173 174 n Add new files only. A specified file is added only if 175 it isn't already in the archive. 176 177 h Use the high performance compression algorithm. This 178 option may be used with either the add (a) or filter 179 (f) commands to gain extra compression at the expense 180 of using somewhat more processor time. Extracting files 181 compressed with the method is usually slightly faster 182 than those saved with the default method. 183 184 P Pack archive after files have been added. 185 186 u Applied to the a command, this modifier makes it behave 187 identically to the u command. 188 189 The combination of the n modifier with the u modifier 190 or u command causes addition of a file to the archive 191 either if the file is not already in the archive, or if 192 the file is already in the archive but the archived 193 copy is older than the copy being added. 194 195 : Do not store directory names. In the absence of this 196 modifier zoo stores the full pathname of each archived 197 file. 198 199 I Read filenames to be archived from standard input. Zoo 200 will read its standard input and assume that each line 201 of text contains a filename. Under AmigaDOS and the 202 **IX family, the entire line is used. Under MS-DOS and 203 VAX/VMS, zoo assumes that the filename is terminated by 204 a blank, tab, or newline; thus it is permissible for 205 the line of text to contain more than one field 206 separated by white space, and only the first field will 207 be used. 208 209 Under the **IX family of operating systems, zoo can be 210 used as follows in a pipeline: 211 212 find . -print | zoo aI sources 213 214 If the I modifier is specified, no filenames may be 215 supplied on the command line itself. 216 217 +,- These modifiers take effect only if the a command 218 results in the creation of a new archive. + causes any 219 newly-created archive to have generations enabled. - 220 is provided for symmetry and causes any newly-created 221 archive to have generations disabled; this is also the 222 default if neither + nor - is specified. 223 224 Files are extracted from an archive with the command: 225 226 zoo {ex}[dNoOpqS./@] archive [file] ... 227 228 The e and x commands are synonymous. If no file was speci- 229 fied, all files are extracted from the archive. 230 231 The following modifiers are specific to the e and x com- 232 mands: 233 234 N Do not save extracted data but report any errors 235 encountered. 236 237 O Overwrite files. Normally, if a file being extracted 238 would overwrite an already-existing file of the same 239 name, zoo asks you if you really want to overwrite it. 240 You may answer the question with `y', which means yes, 241 overwrite; or `n', which means no, don't overwrite; or 242 `a', which means assume the answer is `y' for this and 243 all subsequent files. The O modifier makes zoo assume 244 that files may always be overwritten. Neither answer- 245 ing the question affirmatively nor using O alone will 246 cause read-only files to be overwritten. 247 248 On **IX systems, however, doubling this modifier as OO 249 will force zoo to unconditionally overwrite any read- 250 protected files with extracted files if it can do so. 251 252 The O, N, and p modifiers are mutually exclusive. 253 254 S Supersede newer files on disk with older extracted 255 files. Unless this modifier is used, zoo will not 256 overwrite a newer existing file with an older extracted 257 file. 258 259 o This is equivalent to the O modifier if and only if it 260 is given at least twice. It is otherwise ignored. 261 262 p Pipe extracted data to standard output. Error messages 263 are piped to standard output as well. However, if a 264 bad CRC is detected, an error message is sent both to 265 standard error and to standard output. 266 267 / Extract to original pathname. Any needed directories 268 must already exist. In the absence of this modifier 269 all files are extracted into the current directory. If 270 this modifier is doubled as //, required directories 271 need not exist and are created if necessary. 272 273 The management of multiple generations of archived files is 274 done with the commands: 275 276 zoo gl[Aq]{+-=}number archive files .. 277 zoo gc[q]{+-=}number archive files .. 278 zoo gA[q]- archive 279 zoo gA[q]+ archive 280 281 The first form, gl, adjusts the generation limit of selected 282 files by the specified value. If the form =n is used, where 283 n is a decimal number, this sets the generation limit to the 284 specified value. If + or - are used in placed of = the 285 effect is to increment or decrement the generation limit by 286 the specified value. For example, the command 287 288 zoo gl=5 xyz : 289 290 291 sets the generation limit of each file in the archive 292 xyz.zoo to a value of 5. The command 293 294 zoo gl-3 xyz : 295 296 297 decrements the generation limit of each file in the archive 298 to 3 less than it currently is. 299 300 If the A modifier is used, the archive-wide generation limit 301 is adjusted instead. 302 303 The number of generations of a file maintained in an archive 304 is limited by the file generation limit, or the archive gen- 305 eration limit, whichever is lower. As a special case, a 306 generation limit of 0 stands for no limit. Thus the default 307 file generation limit of 0 and archive generation limit of 3 308 limits the number of generations of each file in a newly- 309 created archive to three. 310 311 The generation limit specified should be in the range 0 312 through 15; any higher numbers are interpreted modulo 16. 313 314 The second form of the command, using gc, adjusts the gen- 315 eration count of selected files. Each file has a generation 316 count of 1 when it is first added to an archive. Each time 317 a file by the same name is added again to an archive, it 318 receives a generation count that is one higher than the 319 highest generation count of the archived copy of the file. 320 The permissible range of generation counts is 1 through 321 65535. If repeated manipulations of an archive result in 322 files having very high generation counts, they may be set 323 back to lower numbers with the gc command. The syntax of 324 the command is analogous to the syntax of the gl command, 325 except that the A modifier is not applicable to the gc com- 326 mand. 327 328 The third form, gA-, disables generations in an archive. 329 Generations are off when an archive is first created, but 330 may be enabled with the fourth form of the command, gA+. 331 When generations are disabled in an archive, zoo will not 332 display generation numbers in archive listings or maintain 333 multiple generations. Generations can be re-enabled at any 334 time, though manipulation of an archive with repeated inter- 335 spersed gA- and gA+ commands may result in an archive whose 336 behavior is not easily understandable. 337 338 Archived files are listed with the command: 339 340 zoo {lLvV}[aAcCdfgmqvV@/1+-] archive[.zoo] [file] ... 341 342 l Information presented includes the date and time of 343 each file, its original and current (compressed) sizes, 344 and the percentage size decrease due to compression 345 (labelled CF or compression factor). If a file was 346 added to the archive in a different timezone, the 347 difference between timezones is shown in hours as a 348 signed number. As an example, if the difference is 349 listed as +3, this means that the file was added to the 350 archive in a timezone that is 3 hours west of the 351 current timezone. The file time listed is, however, 352 always the original timestamp of the archived file, as 353 observed by the user who archived the file, expressed 354 as that user's local time. (Timezone information is 355 stored and displayed only if the underlying operating 356 system knows about timezones.) 357 358 If no filename is supplied all files are listed except 359 deleted files. 360 361 Zoo selects which generation(s) of a file to list 362 according to the following algorithm. 363 364 If no filename is supplied, only the latest generation 365 of each file is listed. If any filenames are 366 specified, and a generation is specified for an argu- 367 ment, only the requested generation is listed. If a 368 filename is specified ending with the generation char- 369 acter (`:' or `;'), all generations of that file are 370 listed. Thus a filename argument of the form zoo.c 371 will cause only the latest generation of zoo.c to be 372 listed; an argument of the form zoo.c:4 will cause 373 generation 4 of zoo.c to be listed; and an argument of 374 the form zoo.c: or zoo.c:* will cause all generations 375 of zoo.c to be listed. 376 377 L This is similar to the l command except that all sup- 378 plied arguments must be archives and all non-deleted 379 generations of all files in each archive appear in the 380 listing. 381 382 On **IX systems, on which the shell expands arguments, 383 if multiple archives are to be listed, the L command 384 must be used. On other systems (VAX/VMS, AmigaDOS, 385 MSDOS) on which wildcard expansion is done internally 386 by zoo, wildcards may be used in the archive name, and 387 a multiple archive listing obtained, using the l com- 388 mand. 389 390 v This causes any comment attached to the archive to be 391 listed in addition to the other information. 392 393 V This causes any comment attached to the archive and 394 also any comment attached to each file to be listed. 395 396 Both the V and v command characters can also be used as 397 modifiers to the l and L commands. 398 399 In addition to the general modifiers described later, the 400 following modifiers can be applied to the archive list com- 401 mands. 402 403 a This gives a single-line format containing both each 404 filename and the name of the archive, sorted by archive 405 name. It is especially useful with the L command, 406 since the result can be further sorted on any field to 407 give a master listing of the entire contents of a set 408 of archives. 409 410 A This causes any comment attached to the archive to be 411 listed. 412 413 g This modifier causes file generation information to be 414 listed about the archive. For each file listed, the 415 user-specified generation limit, if any, is listed. 416 For example, `3g' for a file means that the user wants 417 no more than three generations of the file to be kept. 418 In archives created by older versions of zoo, the list- 419 ing will show `-g', meaning that no generation informa- 420 tion is kept and multiple generations of the file are 421 not being maintained. 422 423 In addition to the generation information for each 424 file, the archive-wide generation limit, if any, is 425 shown at the end of the listing. If generations have 426 been disabled by the user, this is so indicated, for 427 example: 428 429 Archive generation limit is 3 (generations off). 430 431 For more information about generations see the descrip- 432 tion of the g command. 433 434 m This modifier is currently applicable to **IX systems 435 only. It causes the mode bits (file protection code) 436 of each file to be listed as a three-digit octal 437 number. Currently zoo preserves only the lowest nine 438 mode bits. Their meanings are as described in the **IX 439 documentation for the chmod(1) command. 440 441 C This modifier causes the stored cyclic redundancy code 442 (CRC) for each archived file to be shown as a four- 443 digit hexadecimal number. 444 445 1 This forces one filename to be listed per line. It is 446 most useful in combination with the f modifier. 447 448 / This forces any directory name to be always listed, 449 even in fast columnized listings that do not normally 450 include any directory names. 451 452 +,- The - modifier causes trailing generation numbers to be 453 omitted from filenames. The + modifier causes the 454 trailing generation numbers to be shown, which is also 455 the default if neither - nor + is specified. 456 457 Files may be deleted and undeleted from an archive with the 458 following commands: 459 460 zoo {DU}[Pq1] archive file ... 461 462 The D command deletes the specified files and the U command 463 undeletes the specified files. The 1 modifier (the digit 464 one, not the letter ell) forces deletion or undeletion of at 465 most one file. If multiple instances of the same file exist 466 in an archive, use of the 1 modifier may allow selective 467 extraction of one of these. 468 469 Comments may be added to an archive with the command: 470 471 zoo c[A] archive 472 473 Without the modifier A, this behaves identically to the 474 -comment command. With the modifier A, the command serves 475 to add or update the comment attached to the archive as a 476 whole. This comment may be listed with the lA, LA, v, and V 477 commands. Applying the cA command to an archive that was 478 created with an older version of zoo will result in an error 479 message requesting that the user first pack the archive with 480 the P command. This reorganizes the archive and creates 481 space for the archive comment. 482 483 The timestamp of an archive may be adjusted with the com- 484 mand: 485 486 zoo T[q] archive 487 488 Zoo normally attempts to maintain the timestamp of an 489 archive to reflect the age of the newest file stored in it. 490 Should the timestamp ever be incorrect it can be fixed with 491 the T command. 492 493 An archive may be packed with the command: 494 495 zoo P[EPq] archive 496 497 If the backup copy of the archive already exists, zoo will 498 refuse to pack the archive unless the P modifier is also 499 given. The E modifier causes zoo not to save a backup copy 500 of the original archive after packing. A unique temporary 501 file in the current directory is used to initially hold the 502 packed archive. This file will be left behind if packing is 503 interrupted or if for some reason this file cannot be 504 renamed to the name of the original archive when packing is 505 complete. 506 507 Packing removes any garbage data appended to an archive 508 because of Xmodem file transfer and also recovers any wasted 509 space remaining in an archive that has been frequently 510 updated or in which comments were replaced. Packing also 511 updates the format of any archive that was created by an 512 older version of zoo so that newer features (e.g. archive- 513 wide generation limit, archive comment) become fully avail- 514 able. 515 516 Zoo can act as a pure compression or uncompression filter, 517 reading from standard input and writing to standard output. 518 This is achieved with the command: 519 520 zoo f{cu}[h 521 522 where c specifies compression, u specifies uncompression, 523 and h used in addition requests the high-performance 524 compression be used. A CRC value is used to check the 525 integrity of the data. The compressed data stream has no 526 internal archive structure and contains multiple files only 527 if the input data stream was already structured, as might be 528 obtained, for example, from tar or cpio. 529 530 Modem transfers can be speeded up with these commands: 531 532 zoo fc < file | sz ... rz | zoo fu > file 533 534 535 General modifiers 536 537 The following modifiers are applicable to several commands: 538 539 c Applied to the a and u commands, this causes the user 540 to be prompted for a comment for each file added to the 541 archive. If the file being added has replaced, or is a 542 newer generation of, a file already in the archive, any 543 comment attached to that file is shown to the user and 544 becomes attached to the newly-added file unless the 545 user changes it. Possible user responses are as 546 described for the -comment command. Applied to the 547 archive list command l, the c modifier causes the list- 548 ing of any comments attached to archived files. 549 550 . In conjunction with / or // this modifier causes any 551 extracted pathname beginning with `/' to be interpreted 552 relative to the current directory, resulting in the 553 possible creation of a subtree rooted at the current 554 directory. In conjunction with the command P the . 555 modifier causes the packed archive to be created in the 556 current directory. This is intended to allow users 557 with limited disk space but multiple disk drives to 558 pack large archives. 559 560 d Most commands that act on an archive act only on files 561 that are not deleted. The d modifier makes commands 562 act on both normal and deleted files. If doubled as 563 dd, this modifier forces selection only of deleted 564 files. 565 566 f Applied to the a and u commands, the f modifier causes 567 fast archiving by adding files without compression. 568 Applied to l it causes a fast listing of files in a 569 multicolumn format. 570 571 q Be quiet. Normally zoo lists the name of each file and 572 what action it is performing. The q modifier 573 suppresses this. When files are being extracted to 574 standard output, the q modifier suppresses the header 575 preceding each file. When archive contents are being 576 listed, this modifier suppresses any header and 577 trailer. When a fast columnized listing is being 578 obtained, this modifier causes all output to be com- 579 bined into a single set of filenames for all archives 580 being listed. 581 582 When doubled as qq, this modifier suppresses WARNING 583 messages, and when tripled as qqq, ERROR messages are 584 suppressed too. FATAL error messages are never 585 suppressed. 586 587 Recovering data from damaged archives 588 589 The @ modifier allows the user to specify the exact position 590 in an archive where zoo should extract a file from, allowing 591 damaged portions of an archive to be skipped. This modifier 592 must be immediately followed by a decimal integer without 593 intervening spaces, and possibly by a comma and another 594 decimal integer, giving a command of the form l@m or l@m,n 595 (to list archive contents) or x@m or x@m,n (to extract files 596 from an archive). Listing or extraction begin at position m 597 in the archive. The value of m must be the position within 598 the archive of an undamaged directory entry. This position 599 is usually obtained from fiz(1) version 2.0 or later. 600 601 If damage to the archive has shortened or lengthened it, all 602 positions within the archive may be changed by some constant 603 amount. To compensate for this, the value of n may be 604 specified. This value is also usually obtained from fiz(1). 605 It should be the position in the archive of the file data 606 corresponding to the directory entry that has been specified 607 with m. Thus if the command x@456,575 is given, it will 608 cause the first 456 bytes of the archive to be skipped and 609 extraction to begin at offset 456; in addition, zoo will 610 attempt to extract the file data from position 575 in the 611 archive instead of the value that is found in the directory 612 entry read from the archive. For example, here is some of 613 the output of fiz when it acts on a damaged zoo archive: 614 615 **************** 616 2526: DIR [changes] ==> 95 617 2587: DATA 618 **************** 619 3909: DIR [copyrite] ==> 1478 620 3970: DATA 621 4769: DATA 622 **************** 623 624 In such output, DIR indicates where fiz found a directory 625 entry in the archive, and DATA indicates where fiz found 626 file data in the archive. Filenames located by fiz are 627 enclosed in square brackets, and the notation "==> 95" 628 indicates that the directory entry found by fiz at position 629 2526 has a file data pointer to position 95. (This is 630 clearly wrong, since file data always occur in an archive 631 after their directory entry.) In actuality, fiz found file 632 data at positions 2587, 3970, and 4769. Since fiz found 633 only two directory entries, and each directory entry 634 corresponds to one file, one of the file data positions is 635 an artifact. 636 637 In this case, commands to try giving to zoo might be 638 x@2526,2587 (extract beginning at position 2526, and get 639 file data from position 2587), x@3090,3970 (extract at 3090, 640 get data from 3970) and x@3909,4769 (extract at 3909, get 641 data from 4769). Once a correctly-matched directory 642 entry/file data pair is found, zoo will in most cases syn- 643 chronize with and correctly extract all files subsequently 644 found in the archive. Trial and error should allow all 645 undamaged files to be extracted. Also note that self- 646 extracting archives created using sez (the Self-Extracting 647 Zoo utility for MS-DOS), which are normally executed on an 648 MS-DOS system for extraction, can be extracted on non-MSDOS 649 systems using zoo's damaged-archive recovery method using 650 the @ modifier. 651 652 Wildcard handling 653 654 Under the **IX family of operating systems, the shell nor- 655 mally expands wildcards to a list of matching files. Wild- 656 cards that are meant to match files within an archive must 657 therefore be escaped or quoted. When selecting files to be 658 added to an archive, wildcard conventions are as defined for 659 the shell. When selecting files from within an archive, 660 wildcard handling is done by zoo as described below. 661 662 Under MS-DOS and AmigaDOS, quoting of wildcards is not 663 needed. All wildcard expansion of filenames is done by zoo, 664 and wildcards inside directory names are expanded only when 665 listing or extracting files but not when adding them. 666 667 The wildcard syntax interpreted by zoo is limited to the 668 following characters. 669 670 * Matches any sequence of zero or more characters. 671 672 ? Matches any single character. 673 674 Arbitrary combinations of * and ? are allowed. 675 676 / If a supplied pattern contains a slash anywhere in it, 677 then the slash separating any directory prefix from the 678 filename must be matched explicitly. If a supplied 679 pattern contains no slashes, the match is selective 680 only on the filename. 681 682 c-c Two characters separated by a hyphen specify a charac- 683 ter range. All filenames beginning with those charac- 684 ters will match. The character range is meaningful 685 only by itself or preceded by a directory name. It is 686 not specially interpreted if it is part of a filename. 687 688 : and ; 689 These characters are used to separate a filename from a 690 generation number and are used when selecting specific 691 generations of archived files. If no generation char- 692 acter is used, the filename specified matches only the 693 latest generation of the file. If the generation char- 694 acter is specified, the filename and the generation are 695 matched independently by zoo's wildcard mechanism. If 696 no generation is specified following the : or ; charac- 697 ter, all generations of that file will match. As a 698 special case, a generation number of 0 matches only the 699 latest generation of a file, while ^0 matches all gen- 700 erations of a file except the latest one. If no 701 filename is specified preceding the generation charac- 702 ter, all filenames will match. As a corollary, the 703 generation character by itself matches all generations 704 of all files. 705 706 MS-DOS users should note that zoo does not treat the dot as 707 a special character, and it does not ignore characters fol- 708 lowing an asterisk. Thus * matches all filenames; *.* 709 matches filenames containing a dot; *_* matches filenames 710 containing an underscore; and *z matches all filenames that 711 end with the character z, whether or not they contain a dot. 712 713 Usage hints 714 715 The Novice command set in zoo is meant to provide an inter- 716 face with functionality and format that will be familiar to 717 users of other similar archive utilities. In keeping with 718 this objective, the Novice commands do not maintain or use 719 any subdirectory information or allow the use of zoo's abil- 720 ity to maintain multiple generations of files. For this 721 reason, users should switch to exclusively using the Expert 722 commands as soon as possible. 723 724 Although the Expert command set is quite large, it should be 725 noted that in almost every case, all legal modifiers for a 726 command are fully orthogonal. This means that the user can 727 select any combination of modifiers, and when they act 728 together, they will have the intuitively obvious effect. 729 Thus the user need only memorize what each modifier does, 730 and then can combine them as needed without much further 731 thought. 732 733 For example, consider the a command which is used to add 734 files to an archive. By itself, it simply adds the speci- 735 fied files. To cause only already-archived files to be 736 updated if their disk copies have been modified, it is only 737 necessary to add the u modifier, making the command au. To 738 cause only new files (i.e., files not already in the 739 archive) to be added, the n modifier is used to create the 740 command an. To cause both already-archived files to be 741 updated and new files to be added, the u and n modifiers can 742 be used together, giving the command aun. Since the order 743 of modifiers is not significant, the command could also be 744 anu. 745 746 Further, the c modifier can be used to cause zoo to prompt 747 the user for a comment to attach to each file added. And 748 the f modifier can cause fast addition (addition without 749 compression). It should be obvious then that the command 750 auncf will cause zoo to update already-archived files, add 751 new files, prompt the user for comments, and do the addition 752 of files without any compression. Furthermore, if the user 753 wishes to move files to the archive, i.e., delete the disk 754 copy of each file after it is added to the archive, it is 755 only necessary to add the M modifier to the command, so it 756 becomes auncfM. And if the user also wishes to cause the 757 archive to be packed as part of the command, thus recovering 758 space from any files that are replaced, the command can be 759 modified to auncfMP by adding the P modifier that causes 760 packing. 761 762 Similarly, the archive listing commands can be built up by 763 combining modifiers. The basic command to list the contents 764 of an archive is l. If the user wants a fast columnized 765 listing, the f modifier can be added to give the lf command. 766 Since this listing will have a header giving the archive 767 name and a trailer summarizing interesting information about 768 the archive, such as the number of deleted files, the user 769 may wish to "quieten" the listing by suppressing these; the 770 relevant modifier is q, which when added to the command 771 gives lfq. If the user wishes to see the **IX mode (file 772 protection) bits, and also information about multiple gen- 773 erations, the modifiers m (show mode bits) and g (show gen- 774 eration information) can be added, giving the command lfqmg. 775 If the user also wishes to see an attached archive comment, 776 the modifier A (for archive) will serve. Thus the command 777 lfqmgA will give a fast columnized listing of the archive, 778 suppressing any header and trailer, showing mode bits and 779 generation information, and showing any comment attached to 780 the archive as a whole. If in addition individual comments 781 attached to files are also needed, simply append the c 782 modifier to the command, making it lfqmgAc. The above com- 783 mand will not show any deleted files, however; to see them, 784 use the d modifier, making the command lfqmgAcd (or double 785 it as in lfqmgAcdd if only the deleted files are to be 786 listed). And if the user also wishes to see the CRC value 787 for each file being listed, the modifier C will do this, as 788 in the command lfqmgAcdC, which gives a fast columnized 789 listing of all files, including deleted files, showing any 790 archive comment and file comments, and file protection codes 791 and generation information, as well as the CRC value of each 792 file. 793 794 Note that the above command lfqmgAcdC could also be abbrevi- 795 ated to VfqmgdC because the command V is shorthand for lcA 796 (archive listing with all comments shown). Similarly the 797 command v is shorthand for lA (archive listing with archive 798 comment shown). Both V and v can be used as modifiers to 799 any of the other archive listing commands. 800 801 Generations 802 803 By default, zoo assumes that only the latest generation of a 804 specified file is needed. If generations other than the 805 latest one need to be selected, this may be done by specify- 806 ing them in the filename. For example, the name stdio.h 807 would normally refer to the latest generation of the file 808 stdio.h stored in a zoo archive. To get an archive listing 809 showing all generations of stdio.h in the archive, the 810 specification stdio.h:* could be used (enclosed in single 811 quotes if necessary to protect the wildcard character * from 812 the shell). Also, stdio.h:0 selects only the latest genera- 813 tion of stdio.h, while stdio.h:^0 selects all generations 814 except the latest one. The : character here separates the 815 filename from the generation number, and the character * is 816 a wildcard that matches all possible generations. For con- 817 venience, the generation itself may be left out, so that the 818 name stdio.h: (with the : but without a generation number or 819 a wildcard) matches all generations exactly as stdio.h:* 820 does. 821 822 If a generation is specified but no filename is present, as 823 in :5, :*, or just :, all filenames of the specified genera- 824 tion will be selected. Thus :5 selects generation 5 of each 825 file, and :* and : select all generations of all files. 826 827 It is important to note that zoo's idea of the latest gen- 828 eration of a file is not based upon searching the entire 829 archive. Instead, whenever zoo adds a file to an archive, 830 it is marked as being the latest generation. Thus, if the 831 latest generation of a file is deleted, then no generation 832 of that file is considered the latest any more. This can be 833 surprising to the user. For example, if an archive already 834 contains the file stdio.h:5 and a new copy is added, appear- 835 ing in the archive listing as stdio.h:6, and then stdio.h:6 836 is deleted, the remaining copy stdio.h:5 will no longer be 837 considered to be the latest generation, and the file 838 stdio.h:5, even if undeleted, will no longer appear in an 839 archive listing unless generation 5 (or every generation) is 840 specifically requested. This behavior will likely be 841 improved in future releases of zoo. 842 843FILES 844 xXXXXXX - temporary file used during packing 845 archive_name.bak - backup of archive 846 847SEE ALSO 848 compress(1), fiz(1) 849 850BUGS 851 When files are being added to an archive on a non-MS-DOS 852 system, it is possible for zoo to fail to detect a full disk 853 and hence create an invalid archive. This bug will be fixed 854 in a future release. 855 856 Files with generation counts that wrap around from 65535 to 857 1 are not currently handled correctly. If a file's genera- 858 tion count reaches a value close to 65535, it should be 859 manually set back down to a low number. This may be easily 860 done with a command such as gc-65000, which subtracts 65000 861 from the generation count of each specified file. This 862 problem will be fixed in a future release. 863 864 Although zoo on **IX systems preserves the lowest nine mode 865 bits of regular files, it does not currently do the same for 866 directories. 867 868 Currently zoo's handling of the characters : and ; in 869 filenames is not robust, because it interprets these to 870 separate a filename from a generation number. A quoting 871 mechanism will eventually be implemented. 872 873 Standard input cannot be archived nor can a created archive 874 be sent to standard output. Spurious error messages may 875 appear if the filename of an archive is too long. 876 877 Since zoo never archives any file with the same name as the 878 archive or its backup (regardless of any path prefixes), 879 care should be taken to make sure that a file to be archived 880 does not coincidentally have the same name as the archive it 881 is being added to. It usually suffices to make sure that no 882 file being archived is itself a zoo archive. (Previous ver- 883 sions of zoo sometimes tried to add an archive to itself. 884 This bug now seems to be fixed.) 885 886 Only regular files are archived; devices and empty direc- 887 tories are not. Support for archiving empty directories and 888 for preserving directory attributes is planned for the near 889 future. 890 891 Early versions of MS-DOS have a bug that prevents "." from 892 referring to the root directory; this leads to anomalous 893 results if the extraction of paths beginning with a dot is 894 attempted. 895 896 VAX/VMS destroys case information unless arguments are 897 enclosed in double quotes. For this reason if a command 898 given to zoo on a VAX/VMS system includes any uppercase 899 characters, it must be enclosed in double quotes. Under 900 VAX/VMS, zoo does not currently restore file timestamps; 901 this will be fixed as soon as I figure out RMS extended 902 attribute blocks, or DEC supplies a utime() function, which- 903 ever occurs first. Other VMS bugs, related to file struc- 904 tures, can often be overcome by using the program bilf.c 905 that is supplied with zoo. 906 907 It is not currently possible to create a zoo archive con- 908 taining all zoo archives that do not contain themselves. 909 910DIAGNOSTICS 911 Error messages are intended to be self-explanatory and are 912 divided into three categories. WARNINGS are intended to 913 inform the user of an unusual situation, such as a CRC error 914 during extraction, or -freshening of an archive containing a 915 file newer than one specified on the command line. ERRORS 916 are fatal to one file, but execution continues with the next 917 file if any. FATAL errors cause execution to be aborted. 918 The occurrence of any of these causes an exit status of 1. 919 Normal termination without any errors gives an exit status 920 of 0. (Under VAX/VMS, however, to avoid an annoying mes- 921 sage, zoo always exits with an error code of 1.) 922 923COMPATIBILITY 924 All versions of zoo on all systems are required to create 925 archives that can be extracted and listed with all versions 926 of zoo on all systems, regardless of filename and directory 927 syntax or archive structure; furthermore, any version of 928 zoo must be able to fully manipulate all archives created by 929 all lower-numbered versions of zoo on all systems. So far 930 as I can tell, this upward compatibility (all manipulations) 931 and downward compatiblity (ability to extract and list) is 932 maintained by zoo versions up to 2.01. Version 2.1 adds the 933 incompatibility that if high-performance compression is 934 used, earlier versions cannot extract files compressed with 935 version 2.1. This is the only incompatibility that is 936 permissible. You are forbidden, with the force of copyright 937 law, to create from the zoo source code any derivative work 938 that violates this compatibility goal, whether knowingly or 939 through negligence. If any violation of this compatibility 940 goal is observed, this should be considered a serious prob- 941 lem and reported to me. 942 943CHANGES 944 Here is a list of changes occurring from version 1.50 to 945 version 2.01. In parentheses is given the version in which 946 each change occurred. 947 948 - (1.71) New modifiers to the list commands permit 949 optional suppression of header and trailer information, 950 inclusion of directory names in columnized listings, 951 and fast one-column listings. 952 953 - (1.71) Timezones are handled. 954 955 - (1.71) A bug was fixed that had made it impossible to 956 individually update comments for a file whose name did 957 not correspond to MS-DOS format. 958 959 - (1.71) A change was made that now permits use of the 960 shared library on the **IX PC. 961 962 - (1.71) VAX/VMS is now supported reasonably well. 963 964 - (2.00) A comment may now be attached to the archive 965 itself. 966 967 - (2.00) The OO option allows forced overwriting of 968 read-only files. 969 970 - (2.00) Zoo will no longer extract a file if a newer 971 copy already exists on disk; the S option will over- 972 ride this. 973 974 - (2.00) File attributes are preserved for **IX systems. 975 976 - (2.00) Multiple generations of the same file are sup- 977 ported. 978 979 - (2.00) Zoo will now act as a compression or decompres- 980 sion filter on a stream of data and will use a CRC 981 value to check the integrity of a data stream that is 982 uncompressed. 983 984 - (2.00) A bug was fixed that caused removal of a direc- 985 tory link if files were moved to an archive by the 986 superuser on a **IX system. 987 988 - (2.00) The data recovery modifier @ was greatly 989 enhanced. Self-extracting archives created for MS-DOS 990 systems can now be extracted by zoo on any system with 991 help from fiz(1). 992 993 - (2.01) A bug was fixed that had caused the first gen- 994 eration of a file to sometimes unexpectedly show up in 995 archive listings. 996 997 - (2.01) A bug was fixed that had caused the MS-DOS ver- 998 sion to silently skip files that could not be extracted 999 because of insufficient disk space. 1000 1001 - (2.01) A bug was fixed that had sometimes made it 1002 impossible to selectively extract a file by specifying 1003 its name, even though all files could be extracted from 1004 the archive by not specifying any filenames. This 1005 occurred when a file had been archived on a longer- 1006 filename system (e.g. AmigaDOS) and extraction was 1007 attempted on a shorter-filename system (e.g. MS-DOS). 1008 1009 - (2.01) A change was made that will make zoo preserve 1010 the mode (file protection) of a zoo archive when it is 1011 packed. This is effective only if zoo is compiled to 1012 preserve and restore file attributes. Currently this 1013 is so only for **IX systems. 1014 1015 - (2.01) A bug was fixed that had caused an update of an 1016 archive to not always add all newer files. 1017 1018 - (2.01) Blanks around equal signs in commands given to 1019 "make" were removed from the mk* scripts for better 1020 compatiblity with more **IX implementations including 1021 Sun's. 1022 1023 - (2.1) Compression is now greatly improved if the "h" 1024 option is used. 1025 1026 - (2.1) The default behavior is to preserve full path- 1027 names during extraction. 1028 1029 - (2.1) On some systems, extraction of files using the 1030 older (default) compression method is greatly speeded 1031 up. 1032 1033 - (2.1) Extended multiscreen help is available. 1034 1035 - (2.1) Memory allocation is improved, so that the MS-DOS 1036 version will not prematurely abort when updating a 1037 large archive. 1038 1039 - (2.1) The VAX/VMS version preserves file timestamps 1040 during extraction. 1041 1042 - (2.1) The default archive-wide generation limit, when 1043 generations are enabled, is 3. 1044 1045FUTURE DIRECTIONS 1046 A revised version of zoo is in the works that will be able 1047 to write newly-created archives to standard output and will 1048 support multivolume archives. It will be upward and down- 1049 ward compatible with this version of zoo. 1050 1051ACKNOWLEDGEMENTS 1052 The zoo archiver was initially developed using Microsoft C 1053 3.0 on a PC clone manufactured by Toshiba of Japan and 1054 almost sold by Xerox. Availability of the following systems 1055 was helpful in achieving portability: Paul Homchick's Compaq 1056 running Microport System V/AT; The Eskimo BBS somewhere in 1057 Oregon running Xenix/68000; Greg Laskin's system 'gryphon' 1058 which is an Intel 310 running Xenix/286; Ball State 1059 University's AT&T 3B2/300, UNIX PC, and VAX-11/785 (4.3BSD 1060 and VAX/VMS) systems. In addition J. Brian Waters provided 1061 feedback to help me make the code compilable on his Amiga 1062 using Manx/Aztec C. The executable version 2.0 for MS-DOS 1063 is currently compiled with Borland's Turbo C++ 1.0. 1064 1065 Thanks are due to the following people and many others too 1066 numerous to mention. 1067 1068 J. Brian Waters <jbwaters@bsu-cs.bsu.edu>, who has worked 1069 diligently to port zoo to AmigaDOS, created Amiga-specific 1070 code, and continues keeping it updated. 1071 1072 Paul Homchick <rutgers!cgh!paul>, who provided numerous 1073 detailed reports about some nasty bugs. 1074 1075 Bill Davidsen <davidsen@crdos1.crd.ge.com>, who provided 1076 numerous improvements to this manual, contributed mul- 1077 tiscreen help, and provided many useful bug reports, bug 1078 fixes, code improvements, and suggestions. 1079 1080 Mark Alexander <amdahl!drivax!alexande>, who provided me 1081 with some bug fixes. 1082 1083 Haruhiko Okumura, who wrote the ar archiver and some excel- 1084 lent compression code, which I adapted for use in zoo. 1085 1086 Randal L. Barnes <rlb@skyler.mavd.honeywell.com>, who (with 1087 Randy Magnuson) wrote the code to support the preservation 1088 of file timestamps under VAX/VMS. 1089 1090 Raymond D. Gardner, who contributed replacement uncompres- 1091 sion code that on some systems is twice as fast as the 1092 original. 1093 1094 Greg Yachuk and Andre Van Dalen, who independently modified 1095 MS-DOS zoo to support multivolume archives. (This support 1096 is not yet in this official release.) 1097 1098AUTHOR 1099 Rahul Dhesi 1100