[comp.sys.amiga] REXX archiver

rss@ece-csc.UUCP (Ralph Scherp) (05/16/88)

In a previous article (Larry Phillips) writes:
    [discussion about ARC/ZOO etc deleted]
>And now for something completely different. A small ARexx program called
>arcall.rexx, that will recursively go through a directory and rename all
>files, generate a script file while doing so, and ARC the entire kabooble
>into a file called ARCFILE.ARC. The script file created, (a standard
>Amigados script called Exec.me) is included in the ARC, and upon execution,
>will make any necessary subdirectories, and rename all files to their
>original name and position in the directory structure.
>
    [included listing of arcall.rexx deleted]

I like the idea of the REXX program to do this sort of thing.  I started to
put this same sort of program together a while ago, but never got around
to it, mostly because I wanted it to work in all cases and realized that
their were a couple of problems with RexxSupport.library as is.

You use the "SHOWDIR" function to get a directory list.  The one problem
with this is that SHOWDIR returns a complete list of filenames, separated
by spaces.  AmigaDOS filenames can contain spaces [and often do, when 
the files are intended for WBench use rather than CLI]; so parsing out
individual names by breaking up the list returned by SHOWDIR can break
occasionally.

I don't mean this is a flame, just an observation, I'm wondering if their
is a way around this problem.  What I'd really like to see is an expanded
version of the support library which gives access to a lot more of the
Amiga systems.  For instance, ability to query devices, perform wildcard
searches, etc.  For wildcard searches, I was thinking of something like:

     status = opensearch(context,"include:*/*.h")   [...#?/#?.h if you prefer]
to initialize a search, followed by
     filename = search(context)
to get the next filename matching the specified pattern, etc...


At any rate...is there anyone out there who wants to develop a `full-blown'
version of rexxsupport.library?  Or perhaps we can all pool ideas together
and present them to William Hawes so such a library could become part of
the standard AREXX distribution.

Just some deranged ravings to keep you folks amused...

             Mark Lanzo

lphillips@lpami.van-bc.UUCP (Larry Phillips) (05/18/88)

In <3580@ece-csc.UUCP>, rss@ece-csc.UUCP (Ralph Scherp) writes:
>You use the "SHOWDIR" function to get a directory list.  The one problem
>with this is that SHOWDIR returns a complete list of filenames, separated
>by spaces.  AmigaDOS filenames can contain spaces [and often do, when 
>the files are intended for WBench use rather than CLI]; so parsing out
>individual names by breaking up the list returned by SHOWDIR can break
>occasionally.

Yes... my CLI propensity showing through. All files I have any say in are
named without using spaces and it just slipped my mind.

>I don't mean this is a flame, just an observation, I'm wondering if their
>is a way around this problem.

Yes there is, but I suspect it won't be pretty. One thought is to check for
the filename on a word by word basis as in the original, and when it
returns saying the file isn't there, try it with two words, three words,
etc. One other technique that might work is using OVERLAY() to map the
SHOWDIR onto a string with delimiters already in it. It will depend on
whether the space between filenames is treated in the same way as the space
within a filename by the SHOWDIR function. I'll play with it.

-larry

PS: Just spoke to Bill Hawes, and he tells me that SHOWDIR will, in the
next update to ARexx, take an additional parameter. It will be a
'separator' character that will separate the actual file names, leaving the
spaces alone.

--
Janus? Well, look at it this way. If you squint a little, the J could be
       Amiga checkmark, and the rest of the word describes MsDos.
+----------------------------------------------------------------+ 
|   //   Larry Phillips                                          |
| \X/    {ihnp4!alberta!ubc-vision,uunet}!van-bc!lpami!lphillips |
|        COMPUSERVE: 76703,4322                                  |
+----------------------------------------------------------------+

bts@sas.UUCP (Brian T. Schellenberger) (05/21/88)

By the way, for whatever it's worth, I've got "foreach" (of Unix fame),
written in REXX.  It uses the rather clunky approach of doing "backquote"
(another REXX, function which returns the standard output of a command,
like Unix `this`, which I also wrote) of "list" and then filtering out the
garbage, so it is slow and ugly, but it works.

Let me know if sounds interesting, and I'll post it . . .
-- 
 _______________________                             __Brian___________________
|Brian T. Schellenberger| "The Earth is but one     | ...!mcnc!rti!sas!bts     |
|104 Willoughby Lane    | country, and Mankind its  |work: (919) 467-8000 x7783|
|Cary, NC   27513       | citizens" --Baha'u'llah   |home: (919) 469-9389      |