Xref: utzoo comp.sys.amiga:19173 comp.sys.amiga.tech:809 Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!bcm!uhnix2!uhnix1!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: CLI/shells Message-ID: <2027@sugar.UUCP> Date: 20 May 88 02:09:17 GMT References: <8805092047.AA18301@cory.Berkeley.EDU> <1974@sugar.UUCP> <5490@cup.portal.com> Organization: Sugar Land UNIX - Houston, TX Lines: 42 In article <5490@cup.portal.com>, doug-merritt@cup.portal.com writes: > I suspect that the reason that Jeff's code hasn't been used more extensively > is that you've got to put a good wrapper around it. If you want to use it just for command line arguments, anyway. In the latest version of Browser I use it to select groups of files. > Handling *every* possible case, with error checking, is > more complex. But I was real pleased to see "filetype #?/#?/#?" work. Good stuff. > I was thinking about releasing this code I wrote as a library routine. > The interface looks like this: "av = Glob(&ac, av);" Pretty simple, eh? > Anyone need something like this? Is there already something like this > around that I somehow overlooked? I used to use "buildav(&ac, &av)", but really you need to change _main to do the globbing for command line args invisibly, and to provide an analog of Examine/ExNext. The best way to implement that would be to duplicate the name of and interface to Manx' "scdir()". Be my guest. I was going to do all of that stuff, but I'd be as happy to let you. char *scdir(pat) char *pat; Returns a pointer to a static area containing the null-terminated name of the next file that matches a pattern. The area containing the name [and presumably the FileInfoBlock(s) and stuff -- ed.] is statically allocated. > one (dumb) question, though. For some reason I can't find the wildcard > documentation in the AmigaDOS manual. Where is it? I wanna know what > the magic char "%" is for. And to refresh my memory about uses of '#' > other than '#?'. How about "del foo#(.o)" to trash foo and foo.o when you're cleaning house? The # can be used to indicate optional parts of a pattern (tho of course del foo(|.o) should work as well). -- -- Peter da Silva `-_-' ...!hoptoad!academ!uhnix1!sugar!peter -- "Have you hugged your U wolf today?" ...!bellcore!tness1!sugar!peter -- Disclaimer: These may be the official opinions of Hackercorp.