Hi Paul,

> find_prog_in_path() always uses the PATH value in the current
> environment.  It can be very useful to search for programs on
> a path without having to modify the environment first.
> 
> Provide find_in_path_str() which takes a path string to search.
> If the path passed in is NULL, fall back to searching in the
> environment's PATH value.

I have nothing against extending the 'findprog' module in principle.

But the interface that you propose looks odd to me:

  * Why one function that always uses $PATH and one function that
    uses a given set of directories _or_ $PATH?
    Why not simpler: one function that always uses $PATH and one
    function that uses a given set of directories?

  * For the function that uses a given set of directories, isn't
    it easier for the caller to provide a NULL-terminated array
    of directories, rather than to glue them together with a
    platform-dependent separator (':' or ';')?

Because of this oddity, I have to ask: What is the use-case that
you have in mind? The use-case of the existing find_in_path function
is when a program wants to optimize multiple invocations (spawn/exec)
of one given program. What's yours?

Bruno


Reply via email to