>> > In any case, there's no reason to use any of this just to check
>> > whether a file by a specific name exists in a directory.
>>
>> Are you saying you'd just walk along PATH doing a stat() or access()
>> or equivalent on <dir>/sh.exe?
>
> Exactly. Right now, the code already walks along PATH, and constructs
> <dir>/sh.exe, but instead of calling 'stat' or 'access', it calls
> 'file_exists_p', and the side effect of that is that Make reads the
> entire directory <dir> into its internal storage, hashes it, etc.
Am I the only one finding it hard to believe that's anything but hugely
inefficient ? Testing for the existence of a file should not involve
iterating the whole of its directory ! Well, at least, not in userspace
code - if the O/S's implementation of the system function does that,
that's the O/S's affair.
Eddy.
_______________________________________________
Bug-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-make