11.07.2015 Views

Download issue 9 - Total Amiga Magazine

Download issue 9 - Total Amiga Magazine

Download issue 9 - Total Amiga Magazine

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

38SUPPORTBack to Basics: ArchivingArchives of various types are found everywhere, especially on the Internet.Robert Williams explores the most common types and how to deal with them.An archive is a collection offiles, which can be of any type,stored in a single file, thearchive. Most archives can also keepthe files they contain organised in directoriestoo. Archives are often used todistribute software because the programitself, documentation, sample files andeverything else required can be distributedin one archive. This is by nomeans the only use for archives however,at any time you need to group a lotof files an archive can be useful. Manytypes of archive also incorporate somelevel of data compression so the includedfiles are not only neatly groupedtogether but also reduced in size.Compressed archives are very popularon the Internet because a smaller file isquicker to download over a relativelyslow Internet connection.Over the years many different archivefile formats have been developed, mostare available on a range of platforms buteach tends to have a defacto standardarchive format that most software distributionsuse. On the <strong>Amiga</strong> this is theLHA format, whose popularity is largelydue to its use on the Aminet softwarearchive, all software for Aminet must besubmitted in an LHA archive. LHA is acompressed format, although somemore recent formats notable LZX andBZip2 get better levels of compression.How an Archive WorksTo access the files in an archive youIf you can’t handle the shell GUI’s likeOS 3.9’s Unarc come to the rescue.have to extract them from the archive,you can extract single files or all the filesfrom the archive which is often calleddearchiving. With compressed formatsextracting files from an archive is sometimesreferred to as decompressing ordecrunching. Most archive extractionutilities offer you the option of retainingthe directory structure in the archive orjust extracting the files.Creating an archive is usually just acase of specifying the files you wish toinclude and the name of the archive youwish to create. Often the same utility canbe used to create an archive and laterextract files although many formats alsohave a stand alone extractor for usewhen disk space is at a premium.Different types of archive have differentfeatures, often the main difference is thespeed and level of compressionprovided however some also have additionalfeatures, for example passwordprotection.Archiving ToolsMost archiving utilities use a shell basedinterface, this is very useful fordevelopers who can use them in installationscripts, but for users who arenot used to shell programs this canmake them rather intimidating. At theend of this article we have a tutorial onthe basic operations of the LHA archiverwhere you will hopefully find it isn’t toomuch to worry about. However there arealso a host of archiving utilities withgraphical interfaces which should beeasier for new users to handle. Thesetools generally fall into two types:Stand Alone - separate utilities whichhandle creating and extracting archives,these generally allow you to load thearchive, view a list of files and extractthe ones you wish to use. Some aremore sophisticated allowing you to viewfiles without extracting them (technicallythe file is extracted but this is hiddenfrom the user). <strong>Amiga</strong>OS 3.9 is suppliedwith a dearchiving utility called Unarc, ifyou are using DefIcons (also suppliedwith 3.9) Unarc is launched if you doubleclick on an archive that does not havean icon from Workbench.File Managers/File System - Many filemanagers, notably the perennialDirectory Opus, include facilities to handlearchives as if they were anotherdirectory, “opening” an archive simplyproduces a list of files it contains whichcan then be manipulated like any otherdirectory list. For users without a filemanager there are archive file systemswhich work with Workbench howeverthese tend to be somewhat more cumbersomeas Workbench isn’t as customiseableas most file managers.Common ArchiveFormats.lha(Aminet, util/arc/LhA.run)http://lha.warped.com/LHA is by far the most popular archiveron the <strong>Amiga</strong> and lha archives can befound on most <strong>Amiga</strong> websites and CDs..lzx(Aminet, util/arc/lzx121r1.lha)LZX was designed as a replacement forLHA with improved compression,making for smaller archives. It is quitepopular although it never gained reallywidespread acceptance. Manydevelopers still use LZX to distributetheir programs although as it is notaccepted on Aminet an LHA version isusually available too. LZX used to beshareware but the programmer movedon to other things and kindly releasedthe keyfile as freeware. As LZX is nolonger developed it seems unlikely it willgain popularity..zip(util/arc/UnZip.lha and Zip.lha)ZIP is the most popular format on DOSand Windows based PCs where it issupported by a huge range of GUI toolssuch as WinZip. Many <strong>Amiga</strong> Zip toolsare available including command lineversions such as those listed above,UnZip is for extraction and Zip is for thecreation of Zip archives. Many DOS andWindows software packages aresupplied as a self extracting ZIP archive,these are a standard ZIP archive whichalso includes the software required toCLUBBED - Issue 9decompress the ZIP on the target platform,as they are executable they havethe standard program extension “.exe”.If you come across one of these archiveswhich contains information youwant you can still extract them on the<strong>Amiga</strong> just feed them to UnZip as if theywere an ordinary .zip, you will see themessage like “skipping corrupt or extraneousdata” and then the files shouldbe safely dearchived, the data skippedwas just the extractor program..tar(util/pack/UntarV1_11.lha)Tar is an archiver very commonly usedon Unix and similar systems such asLinux, unlike the archivers listed aboveTar does not include any file compression,to overcome this limitation it isoften used in combination with a filecompressor such as the two listedbelow..gz(util/pack/gzip124x2.lha,util/arc/untgz.lha)GZIP is the GNU (GNU’s Not Unix) freesoftware version of the ZIP command,the archives it creates however are notcompatible with Zip. GZip is often usedto compress tar archives on Unixsystems, these are given the extension.tar.gz. In fact this combination is socommon that there are a couple of<strong>Amiga</strong> programs which deal with both atonce, such as the one listed above..bz2(util/arc/bzip2.lha)Bzip 2 is one of the most efficient compressorsavailable however it is purely asingle file compressor and is usuallyused with an archiver such as tar onUnix systems. The current <strong>Amiga</strong> portsseem to be a bit rough around theedges, make sure you set at least 32kbstack (<strong>issue</strong> the command stack 32768before any BZip2 command) and beaware that it compresses in place so theWinter 2001file you are compressing is replaced withthe compressed version.NOTE: The file names given for thesearchivers are just one or two examplesof the programs available to deal with aparticular archive format, check Aminetfor the other options.TIPS: Many of the archivers above areports from Unix like systems, unlike<strong>Amiga</strong> commands which use the “?” optionto display their command template(the options they accept) the standardon Unix is “-h”. Therefore if you type thecommand name followed by -h, for example“UnZip -h” you will often get anice listing of the options allowed.Another common feature of these commandsis that many don’t allow you tospecify a destination directory for theextracted files, they extract into the currentdirectory. So before you set one ofthem off it is a good idea to change tothe destination directory.Other FormatsDisk ImagesAlthough not strictly an archive (it israrely possible to extract individual files)disk images are another popular way ofdistributing software on the Internet. Asthe name implies a disk image is thecontents of a floppy disk dumped into afile, as with archives some formats offercompression. On the <strong>Amiga</strong> the mostpopular disk image formats are DMS(Disk Masher) a compressed format andADF (<strong>Amiga</strong> Disk File) which is the uncompressedformat used by the UAEemulator. Both have extractors availablewhich will write the image back to a realfloppy disk, if you don’t want to botherwith real floppy disks utilities are availableto extract direct to a hard drive oryou can setup a virtual floppy using autility such as FMSDisk from Aminet(disk/misc/fmsdisk.lha).The “?” argument makes most shell commands list their options.SUPPORTLHA TutorialAlthough LHA isn’t the most modern archiveraround it is by far the most commonformat on the <strong>Amiga</strong>, also new versionshave released in the last year thatsupport more efficient compressionmethods. If you download an <strong>Amiga</strong> programfrom the Internet if will almost certainlybe available in an LHA archive. Sohere is a tutorial on the most commonoperations LHA can perform, as you cansee the lha command is used to bothadd and extract files from an archive.When you <strong>issue</strong> an lha command youtell it which lha command you wish toperform (only one command can be performedat a time) and which options youwish to use. Commands are specified bysingle letter codes, for example “l” to listthe contents of an archive. Options arespecified by single letter codespreceded by a “-”, for example “-r” forrecursive, you can combine options bylisting them after the “-”, so “-ar” wouldmean preserve file attributes and recursive.Here are some examples of typicaloperations:Listing the Contents of anLHA ArchiveBefore you extract files from an archiveyou might want to see what it contains,to do this use the “l” command, e.g.:lha l archive.lhaPress Return and a list of all the files inthe archive is shown in the shell window.For a more detailed list which shows thedirectory structure of the archive (whichis needed when you want to extract individualfiles in subdirectories) use the“v” (Verbose list) command instead of “l”.Decrunching an ArchiveExtracting all the files from an archiveonto your hard disk or into the Ram Diskis probably the most common archiveoperation you will perform. For this weneed to use the lha command with onecommand “x” for eXtract with full pathand specify the name of the archive andthe destination where we want the extractedfiles to end up. The syntax forthis command is:lha x archive.lha volume:path/If you do not want the files to retain thepath (directory structure) stored in thearchive use the “e” (Extract) commandalong with the option -x0 instead of “x”.One thing which often catches out newusers (I can remember if frustrating the39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!