On 18 March 2010 22:38, Tim Jenness <[log in to unmask]> wrote:
>
> On Mar 17, 2010, at 10:09 AM, David Berry wrote:
>
>>>
>>
>> Off the top of my head, I can't think why the NDG routines that use
>> ONE_SHELL_ECHO (i.e. the ones that create new output NDFs) should ever
>> end up in a position where the output NDF name contains wild cards.
>> And if there are no wild cards in the output NDF name, then it won't
>> make any difference whether globbing is performed or not.
>>
>
> Ok. I've added a PSX_WORDEXP routine that can mostly replace ONE_SHELL_ECHO and ONE_FIND_FILE. I've left the ONE_ versions unchanged since
>
> - ONE_SHELL_ECHO does not expand globs
> - ONE_FIND_FILE can look inside a directory
>
> I've also modified NDG to use PSX_WORDEXP. Keep an eye out for oddness since I have probably not tested NDG in all its possible uses for metacharacter expansion.
>
> Of note, I can't find a single routine that calls ONE_SHELL_ECHO now. There are four applications using ONE_FIND_FILE (KAPPA, CCDPACK, CONVERT and SST) and they do set the directory search parameter to true so I'm not sure if they can be changed. GRP and CTG are the two libraries using ONE_FIND_FILE (2 out of 3 set ISDIR to true). I imagine that many o the ISDIR=.TRUE. usages are from my cargo-cult patching all these libraries with private wildcard routines to use ONE_FIND_FILE.
>
> Hope this helps.
Great. We should see if this prevents the spurious crashes that occur
if two different processes attempt to run makemap at the same time.
The directory search parameter seems a bit of a red herring, since I'm
not sure how much it is actually used (by users I mean, not by
software). I can't think of any situation where I would use it. If I
want to use all NDFs in directory fred I would always say "IN=fred/*"
rather than "IN=fred". In fact I've often thought how irritating it is
when using "ls fred*" to find files beginning with fred to also get
the contents of directories beginning with fred. Personally, I would
just get rid of the ONE_FIND_FILE calls, use PSX_WOREXP, document the
changed behaviour, and sit back....
David
|