home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1996 / ARCHIVE_96.iso / discs / mag_discs / volume_2 / issue_06 / arcstuff / ARC_DOC < prev   
Text File  |  1988-10-17  |  19KB  |  433 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.           ************************************************************
  8.           *                                                          *
  9.           *                          Beebug                          *
  10.           *                                                          *
  11.           *                    A R C H I M E D E S                   *
  12.           *                                                          *
  13.           *                AA      RRRRRRRR      CCCCCC              *
  14.           *              AA  AA    RR      RR  CC      CC            *
  15.           *            AA      AA  RR      RR  CC                    *
  16.           *            AAAAAAAAAA  RRRRRRRR    CC                    *
  17.           *            AA      AA  RR  RR      CC                    *
  18.           *            AA      AA  RR    RR    CC      CC            *
  19.           *            AA      AA  RR      RR    CCCCCC              *
  20.           *                                                          *
  21.           *                                                          *
  22.           *                     by David Pilling                     *
  23.           *                                                          *
  24.           *                                                          *
  25.           *              This program is Public Domain               *
  26.           *                                                          *
  27.           ************************************************************
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. *********************************************************************************                              ARC Version Numbers                             **                              -------------------                             **                                                                              ** Version 1.0 - 29/06/88       Initial release                                 ** Version 1.1 - 01/09/88       PKARC compatibility added                       ** Version 1.2 - 17/10/88       Network compatible version                      **                                                                              **                                                                              **                                                                              **                                                                              **                                                                              **                                                                              **                                                                              **                                                                              **                                                                              **                                                                              **                                                                              **                                                                              **                                                                              **                                                                              **                                                                              **                                                                              ********************************************************************************* Archimedes ARC                                                          Page 2
  36.  
  37.  
  38.  
  39.                                   Contents
  40.                                   --------
  41.  
  42.  
  43.                          (1) Introduction
  44.                          (2) How to use ARC
  45.                          (3) ARC commands
  46.                          (4) Archimedes ARC file format
  47.                          (5) ARC support
  48.  
  49.  
  50.  
  51. 1. Introduction
  52. ---------------
  53. ARC is the Archimedes archive utility. An archive is a file in which many 
  54. smaller files are stored. You may, using the ARC utility, create archives and 
  55. add files to them (ARC'ing a file) or remove files (de-ARC'ing). One of the 
  56. features of ARC, is that files are stored in a highly compressed form; thus 
  57. saving disc space and allowing more rapid transfer of files by modem. However, 
  58. probably the most useful feature of an archive is that like sub-directories 
  59. in the ADFS, it makes keeping track of files when transferring them from one 
  60. machine to another, much simpler.
  61.  
  62. Archives have a long history going back to UNIX and CP/M. An example of an 
  63. archive with no compression is the UNIX shar format. Whilst on CP/M archive 
  64. utilities which used data compression include squeeze, LUE and LBR. Perhaps 
  65. the most well known archive format and utility is the System Enhancements 
  66. Associates (SEA) ARC for the IBM PC which was based on many of these earlier 
  67. programs. This has now been transferred to the Atari ST and Amiga micros. In 
  68. addition, other more advanced versions of it have appeared on the PC like 
  69. PKARC by Phil Katz. Beebug Archimedes ARC is fully compatible with SEA's ARC 
  70. program. Using it, you can successfully unpack PC archives on your Archimedes, 
  71. as well as create PC format archives. In addition, you can use a special 
  72. Archimedes format archive which while not compatible with the PC, preserves 
  73. Archimedes file attributes like load and exec addresses.
  74.  
  75. If you dial up your local bulletin board, you will see many ARC files (they 
  76. are usually identified by the suffix .ARC). Using ARC, you will be able to 
  77. transfer the files in these to your Archimedes. Obviously, you cannot use 
  78. executable PC programs, but there are many text and data files which you may 
  79. want to examine (such as documentation, C source files, screen images etc.).
  80.  
  81. Do not get the impression from the above, that the data compression aspect of 
  82. ARC is just a side effect. Frequently, you may achieve a space saving of upto 
  83. 90%. Just how much space you save, depends on the type of file being ARC'd. 
  84. Text files usually compress well. Whilst PC executable files rarely compress 
  85. by much, Archimedes executables seem to show good savings in space (often 
  86. owing to Acorn's way of handling arrays and because of the high redundancy in
  87. ARM code).
  88. Archimedes ARC                                                          Page 3
  89.  
  90.  
  91.  
  92. 2. How to use ARC
  93. -----------------
  94. Archimedes ARC consists of two files: the program ARC, and ARC_DOC containing 
  95. this text. You use ARC by typing *arc followed by a number of parameters. If 
  96. you type *arc on its own without parameters, a page of help information is 
  97. displayed. For example:
  98.  
  99.  
  100.     *arc
  101.  
  102.     Archimedes ARC - Archive utility
  103.     Usage: ARC {amufdxeplt}[bswnoiq][g<password>] <archive> [<filename> . . .]
  104.     Where:   a   = add files to archive
  105.              m   = move files to archive
  106.              u   = update files in archive
  107.              f   = freshen files in archive
  108.              d   = delete files from archive
  109.              x,e = extract files from archive
  110.              p   = print file to screen
  111.              l   = listing of files in archive
  112.              t   = test archive integrity
  113.              b   = retain backup copy of archive
  114.              s   = suppress compression (store only)
  115.              w   = suppress warning messages
  116.              n   = suppress notes and comments
  117.              o   = overwrite existing files when extracting
  118.              i   = Use IBM PC Archive format
  119.              q   = Use PKARC style squashing
  120.              g   = Encrypt/decrypt archive entry
  121.  
  122.     Written for the Archimedes by David Pilling
  123.     Put in the Public Domain by BEEBUG V1.1 September 1988
  124.  
  125.  
  126. Although the syntax of the ARC program may look a little frightening at first, 
  127. it is really quite straightforward. Typically you will almost always use just 
  128. a few of these options. The letters which appear after 'ARC', split into two 
  129. groups; commands amufdxeplt and options bswnoiq and g. In general, you should 
  130. have just one command letter and as many options as you need. The next section 
  131. looks at the commands and options.
  132. Archimedes ARC                                                          Page 4
  133.  
  134.  
  135.  
  136. 3. ARC commands
  137. ---------------
  138.  
  139.  
  140. a   = add files to archive
  141.  
  142.       This command is used to add files to an archive. If the archive does not 
  143.       exist, it is automatically created. An example of this command is:
  144.  
  145.           *arc a utils_arc util1 util2 util3 util4
  146.  
  147.       This adds the files util1, util2 etc. to the archive utils_arc. You can 
  148.       use wildcards in this command as follows:
  149.  
  150.           *arc a my_arc b* 
  151.  
  152.       This will add all files whose names begin with 'b' to the archive. You 
  153.       can use any legal filename for the name of the archive, but we recommend 
  154.       that you add the suffix '_arc' to the end of the name. This will help 
  155.       you identify ARC files. In addition, ARC files can also be identified by 
  156.       their filetype, which is set to &DDC (Acorn approved filetype).
  157.  
  158.  
  159. m   = move files to archive
  160.  
  161.       This command is like 'a' except that the files are deleted from the 
  162.       local filing system as they are added to the archive file.
  163.  
  164.  
  165. u   = update files in archive
  166.  
  167.       This only adds files to the archive if the versions on disc have a more 
  168.       recent date stamp, or if they are not already in the archive. For 
  169.       example:
  170.  
  171.           *arc u my_arc
  172.  
  173.       will update all files in the current directory that have been created or 
  174.       changed since they were last archived.
  175.  
  176.  
  177. f   = freshen files in archive
  178.  
  179.       This is like the 'a' command, except that files are only added if they 
  180.       already exist in the archive with an earlier date stamp.
  181.  
  182.  
  183. d   = delete files from archive
  184.  
  185.       This command allows you to delete files from an archive. For example:
  186.  
  187.           *arc d my_arc bob
  188.  
  189.       will remove the file bob from the archive file.
  190. Archimedes ARC                                                          Page 5
  191.  
  192.  
  193.  
  194. x,e = extract files from archive
  195.  
  196.       These two commands, remove files from an archive and create them in a 
  197.       usable form on your disc. For example;
  198.  
  199.           *arc x my_arc util1
  200.  
  201.       recreates the file 'util1' from the archive. Notice that 'util1' remains 
  202.       part of the archive. If you want to extract all the files, simply type:
  203.  
  204.           *arc x my_arc
  205.  
  206.  
  207. p   = print file to screen
  208.  
  209.       This is very similar to 'x' and 'e' except that the file is printed out 
  210.       on the screen, instead of being sent to the filing system.
  211.  
  212.  
  213. l   = listing of files in archive
  214.  
  215.       This very useful command shows you the contents of an archive along with 
  216.       much useful information. For example, to see the contents of the archive 
  217.       called 'my_arc', type:
  218.  
  219.           *arc l my_arc
  220.  
  221.       You can, of course, specify individual files or groups of files using 
  222.       wildcards. For example:
  223.  
  224.           *arc l my_arc pr*
  225.  
  226.       The information displayed gives the original length of the file, 
  227.       and how long it is in its compressed form. The time and date stamps for 
  228.       the file and information on which form of data compression has been used 
  229.       to store the file. You will notice that this is preceded by either 'PC' 
  230.       or 'ARC', which indicates whether the file is stored in PC or Archimedes 
  231.       format. 
  232.  
  233.  
  234. t   = test archive integrity
  235.  
  236.       A CRC (Cyclic Redundancy Check) is kept for each file added to the 
  237.       archive, this allows ARC to tell you if a file has been corrupted. This 
  238.       can happen when you are transferring files between different computers. 
  239.       The 't' command unpacks all of the archive entries (without saving them 
  240.       anywhere), and checks the CRC for each file against the recorded value. 
  241.       It reports back to you any damage to the archive. For example, to test 
  242.       that the archive 'my_arc' has been recieved correctly, type:
  243.  
  244.           *arc t my_arc
  245. Archimedes ARC                                                          Page 6
  246.  
  247.  
  248.  
  249. b   = retain backup copy of archive
  250.  
  251.       When you add a file to an archive, the original archive is renamed to 
  252.       B_oldname. Normally, this is deleted after the file has been succesfully 
  253.       added. By using the 'b' option, you can keep a copy of the original 
  254.       archive. For example, if you wanted to add the file 'program' to the
  255.       archive 'my_arc', but want to keep a backup copy of the archive, 
  256.       then type:
  257.  
  258.           *arc ab my_arc program
  259.  
  260.       The backup archive is called 'b_my_arc'.
  261.  
  262.  
  263. s   = suppress compression (store only)
  264.  
  265.       This allows you to add files to the archive without compressing them.
  266.  
  267.  
  268. w   = suppress warning messages
  269.  
  270.       This option prevents warning messages being printed.
  271.  
  272.  
  273. n   = suppress notes and comments
  274.  
  275.       This option suppresses notes and comments.
  276.  
  277.  
  278. o   = overwrite existing files when extracting
  279.  
  280.       When you extract a file, it may be that a file with the same name 
  281.       already exists. Normally, you will be prompted to overwrite the file. If 
  282.       you then select N, you will be prompted for permission to rename the 
  283.       file. If you then select Y, ARC will pick a sensible name, but if you 
  284.       select N, ARC will continue to the next file to be extracted. The 'o' 
  285.       option allows you to prevent all prompting, and just overwrite existing 
  286.       files. For example:
  287.  
  288.           *arc xo my_arc
  289.  
  290.  
  291. i   = Use IBM PC Archive format
  292.  
  293.       When you add a file to an archive, ARC assumes that you want the file to 
  294.       be stored with its load and exec addresses and attributes. However, if 
  295.       you want to give an archive to a friend with a PC, you should store the 
  296.       files in PC format by adding the 'i' option to the command line. For 
  297.       example, to add a PC file to an archive, type:
  298.  
  299.           *arc ai my_arc PCprog
  300. Archimedes ARC                                                          Page 7
  301. q   = Use PKARC style squashing
  302.  
  303.       Squashing is a variation on LZW coding used by the fairly popular PC
  304.       program PKARC. By adding this option, you make ARC use squashing instead
  305.       of crunching. You should consider that squashing will not always be
  306.       more efficient than crunching and often will produce only small gains. 
  307.       However, there are far more copies of ARC than PKARC, and these will not
  308.       be able to unpack squashed archives. ARC from version 1.1, can unpack
  309.       IBMPC archives made using PKARC and it will do this whether you set the
  310.       q flag or not.
  311.  
  312.  
  313. g   = Encrypt/decrypt archive entry
  314.  
  315.       The 'g' (garble) option allows you to give a password which is used to 
  316.       encrypt files stored in the archive. The data compression normally 
  317.       applied will make files unreadable using *TYPE or *DUMP, this lets only 
  318.       people who know the password extract them from the archive. For example, 
  319.       if you wish to add 'newfile' to the archive 'my_arc', and encrypt it 
  320.       using the password 'beebug', type:
  321.  
  322.           *arc agbeebug my_arc newfile
  323.  
  324.       When you want to extract the file again, you should type:
  325.  
  326.           *arc xgbeebug my_arc newfile
  327.  
  328.       The password can be any length, and is not case sensitive. You can if 
  329.       you wish use different passwords for each file in an archive, but we 
  330.       advise against it. If you should forget or mistype your password, it is 
  331.       unlikely that you will ever recover the file.
  332. Archimedes ARC                                                          Page 8
  333.  
  334.  
  335.  
  336. 4. Archive file format
  337. ----------------------
  338. An Archive, is a binary file consisting of archive markers, archive headers 
  339. and file data. All archives are preceded by an archive marker. This is a 
  340. single byte of value 27.
  341.  
  342. An archive header, consists of several bytes.
  343.  
  344. byte  1      Header version number. This tells you how the file data is stored 
  345.              and how many bytes there are in the header. The header version 
  346.              numbers for the PC, are detailed below. An Archimedes header 
  347.              version number is identical to the corresponding PC number except 
  348.              it has bit 7 set.
  349.  
  350. bytes 2-15   Filename
  351.  
  352. bytes 16-19  Compressed file length
  353.  
  354. bytes 20,21  File date stamp
  355.  
  356. bytes 22,23  File time stamp
  357.  
  358. bytes 24,25  CRC for the file
  359.  
  360. bytes 26-29  If the header type is greater than 1, these hold the original 
  361.              file length otherwise they are not present.
  362.  
  363. bytes 30-33  If bit 7 of the header version number is set, these bytes hold 
  364.              the Archimedes load address for the file otherwise they are not 
  365.              present. 
  366.  
  367. bytes 34-37  If bit 7 of the header version number is set, these bytes hold 
  368.              the Archimedes exec address for the file otherwise they are not 
  369.              present.
  370.  
  371. bytes 38-41  If bit 7 of the header version number is set, these bytes hold 
  372.              the Archimedes file attributes otherwise they are not present.
  373.  
  374. The archive header, is followed by the file data.
  375.  
  376. The file data is followed by another archive marker
  377.  
  378. The archive finishes with an archive marker followed by a zero byte.
  379.  
  380. The time and date fields are always filled in. If the file has a load and exec 
  381. address, these are the time and date when the file was added to the archive 
  382. otherwise, they are derived from the Archimedes datestamp. In all extract 
  383. operations on Archimedes format archives, the contents of the load and exec 
  384. fields take precedence.
  385.  
  386. PC and ARC formats may be mixed in one archive for use on the Archimedes. 
  387. Archimedes ARC                                                          Page 9
  388.  
  389.  
  390.  
  391. PC ARC Header version numbers:
  392.  
  393.        1 = Old style, no compression
  394.        2 = New style, no compression
  395.        3 = Compression of repeated characters only
  396.        4 = Compression of repeated characters plus Huffman Squeezing
  397.        5 = Lempel-Zev packing of repeated strings (old style)
  398.        6 = Lempel-Zev packing of repeated strings (new style)
  399.        7 = Lempel-Zev Welch packing with improved hash function
  400.        8 = Dynamic Lempel-Zev packing with adaptive reset
  401.        9 = PKARC style squashing
  402.  
  403. The time and date stamps are two byte values from which the time in years 
  404. etc., can be found as follows;
  405.  
  406.        year   = (date >> 9) & 0x7f;   
  407.        month  = (date >> 5) & 0x0f;
  408.        day    = date & 0x1f;
  409.  
  410.        hour   = (time >> 11) & 0x1f;  
  411.        minute = (time >> 5)  & 0x3f;
  412.        second = (time & 0x1f) * 2;
  413.  
  414. Where years are offset from 1980, months begin with 1=January.
  415. Archimedes ARC                                                          Page 10
  416.  
  417.  
  418.  
  419. 5. ARC support
  420. --------------
  421. Please send any comments or suggestions for ARC to the address below. In 
  422. addition, if you would like details of the latest version of ARC and how to 
  423. get hold of a copy, please contact:
  424.  
  425.     Software Manager
  426.     Beebug Ltd.
  427.     Dolphin Place,
  428.     Holywell Hill,
  429.     St. Albans,
  430.     Herts.
  431.     AL1 1EX
  432.  
  433.     Tel. (0727) 40303