[tex-live] texdoc in luatex

Frank Küster frank at kuesterei.ch
Wed Jun 27 18:06:55 CEST 2007


Maarten Sneep <maarten.sneep at xs4all.nl> wrote:

>> I need it for assigning proper viewer commands: Windows has "start %
>> s",
>> Debian Linux "see %s", other Unices individual calls like "gv %s".
>> That's what the old texdoc script uses, and for "`uname -s` =
>> Darwin" it
>> uses "open %s".
>
> That is what I guessed. If you can test for the existence of a
> directory, then it seems that testing for the existence of a file
> should be possible as well. Why not check for the existence of /usr/
> bin/open?
>
> if [ -x /usr/bin/open -a -x ]
> then
> 	handle='/usr/bin/open'
> fi

Yes, that's surely the best way to decide whether open should be used (I
just wasn't sure where it is in the filesystem).
lfs.isfile('/usr/bin/open').  Or even using $PATH

if os.execute('open 2>/dev/null') / 256 == 127 then
   print("does not exist")
end

Hm, what does that give on Windows?  If you don't know, execute the
following lua script

********* snip *********
#!/usr/bin/env texlua

if os.execute('nothere 2>/dev/null') / 256 == 127 then
   print("does not exist")
end
********* snap *********

and tell me the output

Regards, Frank

-- 
Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)


More information about the tex-live mailing list