[tex-live] texdoc in luatex

Hans Hagen pragma at wxs.nl
Thu Jun 28 11:58:54 CEST 2007


Reinhard Kotucha wrote:
> Frank Küster writes:
> 
>  > if os.execute('nothere 2>/dev/null') / 256 == 127 then
>  >    print("does not exist")
>  > end
> 
> /dev/null works on UNIX, on Windows it's nul (and does not appear in
> the filesystem).  However, another nice solution would be to walk
> through the path (os.getenv("PATH")).  With other words, write a
> function which does the same as the UNIX which command.
> 
> Note that paths are separated by ";" on Windows instead of ":".

this is indeed a good test, here i normally use:

if string.find(os.getenv("PATH"),";") then
   -- windows
else
   -- unix
end

doing an os.execute is an unneccessary slow alternative

Hans



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the tex-live mailing list