/* AllZoo v1.0b */ /* by Eddie Churchill c/o Inovatronics, Inc. */ /* This is the commented version. */ /* Due to the comments, this version runs slower */ /* than the non-commented version. */ args = ARG(1) /* get the argument string */ argc = WORDS(args) /* how many words are there in the string */ args = TRANSLATE(args) /* convert the whole thing to uppercase */ SELECT WHEN argc = 0 THEN DO zooname = 'zoofile.zoo' /* make up one on my own */ END WHEN argc = 1 THEN DO zooname = args /* otherwise use yours */ END OTHERWISE DO SAY 'ALLZOO:Unknown options' /* burp! */ SAY ' Usage:ALLZOO [zoofilename] EXIT 10 /* report the error */ END END initpath = PRAGMA('D','') /* get present path */ IF ~ EXISTS(initpath) THEN DO /* for existence */ SAY 'Unable to get a lock on directory ->'initpath EXIT 10 /* report error to user */ END SAY 'Working on' zooname /* are we doing anything */ CALL DODIR() /* start up everthing */ /* tell the user what to do */ SAY 'To extract these files, just use the command: ZOO e// "'zooname'"' EXIT 0 /* recursion is such an ugly sport */ DODIR: PROCEDURE EXPOSE zooname ARG initpath DO /* Because of spaces in some pathnames we have to be tricky. First we get the present directory's directories, but with a twist. You will notice the odd alt-char use for the separator, this was used because most people do not use it in directory names. We then convert all spaces in the directory names to some other weird character, then convert the directory seperator to a space so arexx can count and breakout the individual directories. */ dirlist = SHOWDIR(initpath,'dir','¶') dirlist = TRANSLATE(dirlist,'å',' ') dirlist = TRANSLATE(dirlist,' ','¶') dircount = WORDS(dirlist) DO count = 1 TO dircount /* But before we can use this directory name we must convert all the fake spaces back to real spaces. */ theword = TRANSLATE(word(dirlist,count),' ','å') newpath = initpath || theword || '/' /* better check to see if the directory really exists. */ IF ~ EXISTS(newpath) THEN DO SAY 'Unable to get a lock on directory ->'newpath EXIT 10 END /* Now recursivly call ourself to get any directories in this directory. */ CALL DODIR(newpath) /* Oh! Yea, before we leave we might as well preform the ZOO we came here for. */ IF LENGTH(SHOWDIR(initpath,'FILES')) > 0 THEN DO 'zoo a "'zooname '" "'newpath'*"' END END END RETURN 0