Expand-o-matic: Automatic File Extractor (Well, semi-automatic) Version 1.4 12/20/92 Public Domain by Andrew Cullum If you are already familiar with an earlier version, see the attached update.txt file for a brief list of the changes. This program may be freely copied so long as all three files (expando.prg, expando.txt and expando.rsc) are included in their original (i.e. unmodified) form. If you find this program useful you might consider: Sending the author (namely me) $5-10 Giving blood at your local Red-Cross Going out and buying a commercial program at your local ST dealer Some other good deed Thanks to those who gave me help on Pexec(), namely Carlos Sara, Carlos Varela and Richard Syratt (Hope I got the names right, I'm going from memory) And Thanks to Fred Koch and Gordon Meyer for their suggestions for the upgrade. And forgive me, this is my first attempt at documentation. So, what's it do? Expand-o-matic is a shell for dealing with a variety of compressed formats. Most shells that I have seen allow you to do everything that the various archivers can do, i.e. archive, extract, list files, etc. The problem with this is that they aren't as convenient as they might be. As I almost never do anything other than extract files, I decided to write a shell that is more convenient, at the price of not being able to do the other functions. Thus, after much swearing and reading of manuals (normally in that order, and repeated several times), was born Expand-o-matic. The first time you run the program, you will need to set it up (see the section on Setup below), to tell it which archive types you deal with, and where the program for that type is located. After that, just give it the name of the file, or if you're using NeoDesk or a Tos version of 2.05 or higher, drag the file onto the Expando.prg icon, and off it goes . It looks at the extension of the file you give it, and calls the appropriate program for that type of archive. All this is explained in more detail below. Setup: Before you can extract files with Expand-o-matic you will need to set everything up. To do this go to the Setup option under the File menu, or hit Alt-s. Across the top of the dialog box that appears it will say: Ext. Com. Archive and have a box beneath each. Ext. stands for extension. Click on the box below it and enter the extension for an archive you deal with, such as .ARC or .LZH. If you enter lowercase letters, they will be converted to uppercase for you. Com. stands for command. This is the command that is used to extract that type of archive. For all the archivers that I know of x is the command you want, but I figured I'd play it safe and make it configurable. Click on the box and enter the appropriate command. Archive is the program that should be run for files that end with the extension listed in the first box. Click on the box below Archive and a file selector will pop up. Select the program you want and click on OK. The three boxes should then look something like this: .ARC x D:\ARCHIVES\ARC602\ARC.TTP To add another extension, command and program, click on New. See The New Button below. To set where your files will be extracted to click to the right of where it says Destination. A file selector should appear. Go to the drive and directory that you want and click on OK. To set where it will go to for you to select files, click to the right of where it says Source. Select the source directory as you did for the Destination above. The New Button: Click on the button that says New and you will get a blank entry, in which to add a second set of extension/command/program information. Use the arrows on either side of the boxes at the top to scroll through the sets that you have. The Delete Button: Click on this to delete the set that is currently displayed at the top. You will be asked if you are sure that you want to do this. Click Yes, or hit return, and it will be erased. The Save Button: Click on the Save button to save your current configuration in a file called EXPANDO.CFG. Expand-o-matic looks for this file when it starts up, and read in the information if it finds it. The configuration information is stored in a regular text file, so if things get messed up it should be easy enough to fix. The format is: 2 <---- The number of entries you have .ARC x D:\ARC.TTP <---- The 3 pieces of info for each entry, .ZOO x D:\ZOO.TTP seperated by a space 10 <---- Integer containing the Options settings (see below) E:\NEWSTUFF\ <---- Where to extract files to D:\DOWNLOADS\ <---- Where to go for the files to expand. If you use an archiver that has no command, and need to edit the .CFG file by hand, put a | in for the command. If the command you set up has a space in it, the .CFG file needs a # in place of the space (i.e. 'l#-d' would be saved in place of 'l -d') Options Integer: The first four bits of the integer represent the four options. If bit 1 is set, 'Continue until Cancel' is on, bit 2 is for 'Quit after Auto-run', 3 is 'Remember Directories' and 4 is 'Auto-Create Directories'. 5 is for 'Use File Directory'. If you need to change this, start at 0 (for no options on), add 1 for the first option to be on, 2 for the second, 4 for the third 8 for the fourth, and 16 for the fifth. So, to have 'Continue' and 'Auto-Create' set, you would put 0 + 1 + 8 = 9 on that line. In the example above I have 'Quit' and 'Auto-Create' set (2 + 8). The Reload Button: This will read in the current EXPANDO.CFG file, thus returning all your settings to the last time you saved. The OK Button: Use this to exit Setup The Options Button: This button will take you to a seperate dialog box, with four options listed on it. If the box to the left of the option is shaded, the option is turned on. The options are: Continue Until Cancel? If you have a lot of files to extract, click on the box by Continue Until Cancel. With this set, after the first archive is done, the file selector will appear, prompting you for a second. It will keep doing this until you hit cancel. Quit After Auto-run? If you check this box the program will automatically quit after expanding files passed to it from the command line or by dropping files onto the program. Thus you just have to drop the file on the icon, it'll extract it and then quit, you don't have to do anything else. Remember Directories? If this option is set, the program will keep track of the last directory that you selected a file from while 'Expand'ing, and go back to there for you to select the next one. If this isn't set, the file selector will go back to the folder you put into the 'Source' box. If 'Source' isn't set either, it will go to the folder where expando.prg is. Auto-Create Directory? If this is set, Expand-o-matic will create a folder with the same name as the file you are expanding, minus the extension, and expand the files into there. For instance, if your 'Destination' is 'd:\newstuff\', and you are unarcing 'neato.arc', it would create 'd:\newstuff\neato\' and unarc the files into there. Use File Directory? If this is set your files will be uncompressed to the same directory that your archive is located in (or a folder created in that directory, if you have Auto-Create Directory set). Extracting Files: There are three ways to extract (or expand) files with Expand-o-matic. The easiest way, if you use NeoDesk or TOS 2.05 or higher, is to simply drag the icon for the archive you want to extract files from onto the icon for EXPANDO.PRG. The program will the start up and automatically start extracting for you. If you pass it more than one file this way, by holding down shift and selecting them all, Expand-o-matic will deal with each of them in turn (Multiple files only seems to work under NeoDesk, but I will work on this). The second way is to simply start up the program and go to the Expand option under the Files menu, or hit Alt-e. You will then be presented with a file selector to pick the file that you want it to expand (also see Wildcards below). If you have the Continue Until Cancel option set, you will be presented with the file selector again after the first file is done, and this will continue, surprisingly enough, until you click on Cancel. The last way is to rename EXPANDO.PRG EXPANDO.TTP and then enter the name(s) of the file(s) that you want to expand in the command line. Wildcards: If you are using the Fileselector or Command Line to tell Expand-o-matic which files to extract you can use wildcards to select more than one file. If you enter *.* it will do all files in the path. You can also use *.arc, etc to get all files that use one type of archiver. I think file.* should also work, but I don't think that one will come up much. Anyway, using the file selector after selecting 'Expand', simply enter *.* or *.arc, etc. for the filename. If you are using it as a .ttp, you will need to put 'drive:\path\*.*', etc. (i.e. d:\downloads\*.arc) Questions, Comments, Criticisms, Requests, Enormous Cash Donations? Send 'em on in, I'd love to hear from you. I can be reached at: (In order of speed with which I will see your message, but reverse order of permanence of access for me.) E-mail: elvis@watserv.ucr.edu Genie: A.CULLUM1 Real mail: Andrew Cullum 995 Hymettus Ave Encinitas, CA 92024 (Note: This is my parent's address, but it is much more permanent than my current one is likely to be, and mail can be forwarded from there) Bug Reports: The only problem I've heard of so far is a report that the first time someone tried to set the 'Destination', it didn't record the drive letter. It worked when they entered the path in the file selector by hand, however. They were using UIS III, which I don't have, unfortunately, so I have not been able to try and figure it out. If you experience the same thing: try setting the path by hand in your file selector, and please send me mail letting me know. A brief description of your setup (mostly what software gets auto-loaded) would maybe help me find the answer.