BBCZIP 1.26 =========== J.G.Harston 1999-2005 mdfs.net/Apps/Archivers/BBCZip jgh@arcade.demon.co.uk 70 Camm Street, Walkley, Sheffield S6 3TR Introduction ------------ ZIP archiving is probably the most common method of archiving files, and one of the most common methods of file compression. BBCZIP consists of programs that allow you to create, extract and examine ZIP archives. The BASIC programs will also run on RISC OS systems. The supplied programs are UnZip, Zip, ZipCat, ZipDiff, ZipEx and ZipInfo. They perform the following actions: UnZip - Extracts stored files from a ZIP file Zip - Creates ZIP file, storing files ZipCat - Lists the contents of a Zip file ZipEx - Lists the contents of a Zip file with info like *Ex ZipInfo - Displays detailed info on Zip file contents ZipDiff - Compares a zip archive with a filesystem The distribution also includes the manual entries for the commands which contains full documentation. Other platforms --------------- The only format currently supported is stored ZIP, that is uncompressed files. If used on RISC OS BBCZip can compress and uncompress files if SparkFS is running. There are various ways to create ZIP files with stored data on other systems. Check the documentation for your ZIP creation program, looking for something like 'Options: No Compression' or 'Compression: Stored'. As an example, using PKWare's PKZip program, giving the following command: PKZIP -e0 -p name.zip file will make a ZIP file called name.zip and puts a stored copy of file in it. Using: PKZIP -e0 -p -r name.zip dir\*.* will create a ZIP archive called name.zip containing stored copies of all the files in directory dir and all the contents of dir's subdirectories. Technical Details ----------------- A ZIP file consists of a series of entries in the following format: local file header signature 4 bytes "PK",&03,&04 version needed to extract 2 bytes general purpose bit flag 2 bytes compression method 2 bytes last modification time 2 bytes last modification date 2 bytes crc-32 4 bytes compressed size 4 bytes uncompressed size 4 bytes filename length 2 bytes extra field length 2 bytes filename (variable size) extra field (variable size) data (variable size) Acorn metadata is stored in the extra field in the following format: extra header id 2 bytes "AC" extra header sublength 2 bytes Acorn header id 4 bytes "ARC0" load address 4 bytes execution address 4 bytes attributes 4 bytes &00000000 4 bytes creation time 2 bytes creation date 2 bytes main account number 2 bytes auxilary account number 2 bytes Only that metadata specified by the header sublength is present. Creation and modification times and dates are stored in MS-DOS format. Compatability ------------- BBCZip has been tested and works on BBC B, Master, Compact, Archimedes, DFS, ADFS, HADFS, NFS, 6502Tube, Z80Tube, ARMTube. Version History --------------- *Zip 1.00 06-Jun-1999 Initial version, no CRCs 1.01 01-Sep-1999 Calculates CRCs (very slowly!) 1.02 04-Sep-1999 Writes catalogue at end 1.03 12-Sep-1999 CRCs correct, manually calculated 1.10 28-Sep-1999 Uses mcode to calculate CRCs 1.11 28-Sep-1999 Parses command line 1.12 02-Oct-1999 -a option done (only MDFS, no 'P' yet) 1.13 20-Oct-1999 -t option done, -a is now -X 1.14 28-Oct-1999 Manually calculates CRCs on non-6502 1.15 08-Mar-2000 Display on zero-length files ok 1.16 12-Mar-2000 CRC code for Arc (Z80 next), -a now -X 1.17 18-Jul-2000 Arc can call SparkFS to do compression 1.18 31-Jul-2000 -# -D done, ARM CRC code corrected 1.19 20-Sep-2000 -# allows >9, -255 creates envelopes 1.20 20-Oct-2000 Added -i@file, and -nozipdir options 1.24 15-Dec-2002 Better InitZip 1.25 12-Jan-2003 Doesn't crunch small files 1.26 15-Sep-2005 Workaround to avoid a bug in raFS, fixed long date handling. *UnZip 1.00 06-Jun-1999 Loosely based on Sprow's UnZip, ignores CRCs 1.01 16-Jun-1999 Reads command line 1.02 22-Jun-1999 Dosifies filenames 1.03 17-Jul-1999 Fuller implementation, -X option 1.04 20-Nov-2000 -q quiet mode 1.06 28-Dec-2000 Inflate on RISC OS 1.07 22-Mar-2001 Sets mdate/time, cdate/time on SJ and HADFS 1.08 17-Jun-2001 Split into modules *ZipCat/*ZipEx 0.10 30-Nov-1999 Initial version 0.11 01-Dec-1999 Ignores absent extras fields, better name display *ZipInfo 1.00 06-Jun-1999 Initial version *ZipDiff 1.00 23-Jan-2002 Initial version