Question: condition on external files

27 views
Skip to first unread message

Ingo Albrecht

unread,
Oct 13, 2020, 3:37:28 AM10/13/20
to kl...@googlegroups.com
Hello!

I have a collection of sometimes-useful wrappers for all sorts of POSIX
and Linux system commands that I would like to continue building on:

https://github.com/promovicz/klish-system

Most of these commands are operational-type and are intended as a
generic grab-bag of functionality.

Some tools used are a little rare, such as "hwloc" used for a "show
system topology" command. It would be nice to make such commands
conditional on the presence of the required executable, somewhat similar
to the "access" property.

Does anyone know a way to make commands conditional on the presence of
an external file such as an executable? Using "which" would be nice but
optional.

Can this be done using (e)XSLT? It seems to be possible only using Java:

<xsl:when test="fs:exists(fs:new('myfile.html'))" xmlns:fs="java.io.File">
<!-- do something here... -->
</xsl:when>

(Example from StackOverflow [1])

Greetings and Thanks
prom


[1]
https://stackoverflow.com/questions/2917655/how-do-i-check-for-the-existence-of-an-external-file-with-xsl/32361057#32361057
Reply all
Reply to author
Forward
0 new messages