env and PATH

Federico Kircheis federico@kircheis.it
Tue Jan 7 08:02:02 GMT 2025


>>> Iterating and invoking an external program (cygpath) for every path 
>>> takes some time.
>>
>> Depends on actual use case, it may be just a single invocation for entire
>> list.
> 
> I'm currently not on Windows, you mean it is possible to convert
> 
> C:\Windows;C:\Windows\system32;
> 
> to
> 
> /cygdrive/c/windows:/cygdrive/c/windows/system32
> 
> (or equivalent with /proc) with one invocation of cygpath?
> 
> If that is the option --path (just read from the documentation, I did 
> not notice it before, and did not try it, I will do it in the next days) 
> then I suppose the performance issue I mentioned would be a non-issue. 
> Although I would still have preferred to be able to tell env to use the 
> variable as-is, just like all the others.

Confirmed, with --path it is possible to convert the Windows PATH to a 
cygwin PATH, that then gets converted to a Windows PATH again when 
invoking a Windows program.

One binary call is obviously much faster than iterating every element in 
PATH and converting them one by one, which makes it a viable solution.


More information about the Cygwin mailing list