On Sat, 22 Aug 2020, Darius Blaszyk via fpc-pascal wrote:
On Thu, Aug 20, 2020 at 11:43 PM Darius Blaszyk <dhkblas...@gmail.com>
wrote:
I have done so for the xz format already. The code checks first if the
utility is available and then invokes it. Potentially any other utility
might be included that way. However, I was hoping to include mainly native
libraries where possible to reduce dependencies.
By calling the archive utility from the command line I am able to add more
formats easily. One thing though is that to be more robust I would like to
check the availability of the utility from the command line. One way of
doing this is using "whereis", but I was wondering if something like this
exists already in FPC?
Yes:
https://www.freepascal.org/docs-html/current/rtl/sysutils/exesearch.html
Combine with GetEnvironmentVariable():
Exists:=ExeSearch('myexe',GetEnvironmentVariable('PATH'));
Michael.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal