Re: walk_dir issue

new topic     » goto parent     » topic index » view thread      » older message » newer message

Derek Parnell wrote:

> Juergen Luethje wrote:
>>
>> Derek Parnell wrote:
>>
>>> I'm not sure if this is a bug or design feature but if you pass
>>> a path with wildcards to walk_dir, the routine_id that it calls
>>> receives a Path parameter with the wildcard specification included.
>>>
>>> For example:
>>>
>>>   res = walk_dir("C:\\temp\\test.*", routine_id("dirfunc"), 1)
>>>
>>> Then the routine 'dirfunc' gets "C:\temp\test.*" in the path name
>>> parameter. I was expecting it to get "C:\temp" instead.
>>
>> To me it looks like a design feature. In 'lib_u_z.htm#walk_dir' it
>> reads: "... directory with path name given by st."
>>
>> "C:\\temp\\test.*" is not a valid path name on DOS/Windows because of
>> the '*' that it contains.
>
> In that case its a bug, because it calls my user-defined routine for
> each matching file in c:\temp.

Oops.. yes, of course.

According to the documentation, walk_dir() should raise an error and
display a message such as "'C:\\temp\\test.*' is not a valid path name."
(at least on DOS/Windows).

On the other hand, if it is intended that the first parameter of
walk_dir may contain wildcards (I would appreciate that), then the
documentation should be changed, and the walk_dir() function must be
changed in this case, too.

Regards,
   Juergen

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu