dP .8888b 88 88 " .d888b88 .d8888b. .d8888b. 88aaa 88' `88 88ooood8 88' `88 88 88. .88 88. ... 88. .88 88 `88888P8 `88888P' `88888P8 dP DEAF - Description Extracting And Filenoting (AmiNet oriented) By Manuel Giorgini (mgiorgin@dsi.unive.it) in 1996 *** Disclaimer Briefly: (1) this program comes with no warranty. (2) if your HD burns (or stuff like that), I won't accept any responsibility. (3) I can only guarantee that this program will occupy disk space and (maybe) some memory. This program is CryWare. That is, if you like it and you decide it's worth being used, you're morally obliged to open the window and speak aloud what you think about it, in a language of your choice ;) And BTW if you leave me an EMail with your comments/bugreports/threats/thanks or whatever, I'll send you the complete sourcecode in Amiga E (it's so easy to write down it. But maybe it can still be useful to someone, just to laugh sometimes, or to have something to read in the bathroom :) My address is mgiorgin@dsi.unive.it *** Prologue First of all: Sorry for my bad command of english language. Hi! I run a BBS, and as many other sysops, I like to collect files and put them at my users' disposal. Recently (well, not so recently :) I started leeching megabytes over megabytes of stuff from the AmiNet sites, and moved all my downloads into my file areas. Soon I started getting bored of typing all the filenotes by hand, and after having looked (with no result) for a fitting utility, I worked on my own. Thus, DEAF was born. *** What is this program for? DEAF will scan an archive, extract the description from INSIDE it, and link it as a comment for that file. Suppose you have downloaded "foo.lha" and you have noticed that it contains "foo.readme": DEAF will EXTRACT the "Short:" line from foo.readme (or whatever line else) and will put it as a filenote on "foo.lha" (without the trailing "Short:" and blanks). DEAF will then be able to move that archive in your personal aminet-organized mirror (if you have any), and will take care of discarding obsolete versions. DEAF will recognize LHA, LZX and ZIP archives, and will operate successfully with all of them, provided you have LhA, LZX and UnZip in your path (this is extremely important!); evaluation versions are OK too if you are not using LZX. DEAF by now needs a registered LZX to work, sorry. From v1.02 on, DEAF will use the Shell Copy and Delete commands to accomplish its new features, so you may have to put them in your path too. Maybe such an utility is already existing, but I hadn't been able to find it. I found an utility similar to what DEAF was in its v1.01, but it required the .readme file to be already unarchived and in the same directory as the archive file, and this is rather annoying for people not used to download readme files along with the archives. The .readme file could then be nested into subdirectories in the archive structure, so a manual extraction might be very unhandy and, even worse, difficult to code in a script. Anyway, upon request I succeeded in letting DEAF check for those kind of readme files. So if, say, you have "foo.lha" AND "foo.readme" in the same directory, when "foo.lha" does NOT contain "foo.readme", deaf will automatically look for the so-called 'external' readme file. This file will then be moved along with the archive, or deleted if you tell deaf to do so. It is to say that the archive itself won't be touched (besides when being moved); these operations will regard the unarchived readme files ONLY (those kind of files you get when downloading stuff with an ADT client, for istance). *** Syntax This program works via CLI/Shell only. Nevertheless, it has been developed for script purposes. The command line has changed a bit from v1.01. Remember to update your scripts (if you DID use deaf in your scripts, let me know! i'd be enthusiast ;). 1.Work:> deaf ? FILE/A,DP=DESCPAT/K,KW=KEYWORD/K,TF=TEMPFILE/K,TD=TODIR/K,RP=REPLACES/S, DM=DONTMOVE/S,DC=DONTCREATE/S,DR=DELREADME,Q=QUIET/S: Where: FILE - is the Archived (LhA, LZX, ZIP) file you'd like to comment. No wildcards allowed (but you can still use SPat, or a list LFORMAT). DEAF will automatically recognize the compression type basing on the file extension and launch the appropriate command. DESCPAT - is the descriptor file pattern. (default: *.readme) KEYWORD - is the word (or part of) immediately previous to the description string (default: 'Short:'). No wildcards allowed here too, sorry. Search is CASE SENSITIVE, therefore pay attention. When more than one string is matched, DEAF will get the first only. BTW, you can insert "Author:" or "Uploader:" here; guess what it would produce... :) TEMPFILE - Is the temporaneous workfile for DEAF. It will be (hopefully!) deleted during the operation, so you can definitely forget about it. (default: 'ram:deaf_temp') TODIR - Specifies a root path for an aminet-like partition to store that file in. Example: suppose your readme file contains: Type: comm/misc and you specify "dh0:aminet" ('/' is facultative) as path; your file will then be *moved* (that is, copied and deleted) to "dh0:aminet/comm/misc/". (see DONTMOVE) Every absent directory will be created, in order. Eg. in the case above, deaf would check for "dh0:aminet/comm" first, creating it if needed, then it would do the same for "dh0:aminet/comm/misc". (see DONTCREATE) The 'Copy' and 'Delete' commands *must* be in your path. This switch affects any 'external' readme file too, if present. REPLACES - If selected, and a TODIR path is given, deaf will look for a string like this in the readme: Replaces: comm/misc/oldstuff_v1* and will issue a delete command with a path composed by TODIR and "comm/misc/oldstuff_v1*", actually deleting your files *forever* (until recovered w/ QBTools or similar :). This command, having a wildcard, obviously affects any .readme file present in the directory. DONTMOVE - If selected, original copies of files moved by TODIR won't be deleted. This has been put for your safe. :) This switch affects any 'external' readme file too, if present. DONTCREATE - If selected, and a TODIR path is given, deaf will *not* create any directory it does not find. If it actually happens, deaf will just stop operations at all. DELREADME - If selected, DEAF will delete the "external" readme file, if present. Normally that file would follow the related archive: moved, or just copied, if a TODIR path is given; ignored if the readme file is already present in the archive; left as it was, elsewhere. With this switch, you force deaf to delete it, right after having grabbed the needed information from it. QUIET - Will avoid any message printing; DEAF will anyway still return an error code. Obviously there could still be a message printed, that is the error relative to an eventual ReadArgs() failure :) If you have DEAF in your path, try this: 1.Work:> list >T:script dh0:comms/downloads/#?.??? LFORMAT "deaf %p%n QUIET" 1.Work:> execute t:script voila! For a quick check, try deaf with its very archive: 1.Work:> deaf deaf104.lha If you have an aminet-like organization in one of your HD's, try with 1.Work:> deaf deaf104.lha TODIR dh1:archives/aminet REPLACES *** History v1.00 - First version v1.01 - stuff (trust me, this version is better, it's just that I can't explain efficiently in English what I have done :) v1.02 - Introduced TODIR, REPLACES, DONTMOVE, and lightly improved in other small parts. v1.03 - Now DEAF creates the needed directories (unless specified). DONTCREATE introduced. v1.04 - DEAF now looks for an external .readme file too, when none are matched inside the archive. The source file has been lightly optimized. Fixed a bug in the REPLACEment feature. *** Credits Somebody helped me in developing DEAF, with suggestions and moral support. They are: Ron Burman, Gerard Sweeney, Christian Ruetgers (who suggested the main improvements for v1.02 and v1.04), Rob Saxby. Anyway there is still someone else I'd like to mention: Gabriele Zaverio, Giuseppe Chillemi, and the whole FreakNet network; Claudio Mazzuco, Guido Vaccari, Lorenzo Belloni and all my points; Peter Van Den Broeck, for his friendship; The EFF, for his fight for the freedom of speech and privacy in the 'Net; James McOrmond, for his program JamMail (lightyears beyond TrapDoor!), and Johan Billing, for CrashMail. Smart and strong. Good tosser. Take it. :) EOF