[Gambas-user] Two short questions

GMail adamnt42 at ...626...
Mon Mar 5 05:59:07 CET 2012


On Mon, 2012-03-05 at 12:16 +0800, Ian Roper wrote:
> Could you use
> Exec ["xdg-open", Application.path &/ "myfile.pdf"]
> 
> or is the bad practice ?
> 
> Note # xdg-open is on most Linux Distros and will open a nominated file
> with the correct program if there is one installed for this purpose.
> 
> Regards,
> Ian Roper ~ Perth - Western Australia.
> 
N.B. gb.desktop provides the static Desktop class that does that exact
thing i.e. it runs the xdg.open script (the "portland" script) that is
included in gambas.  Also note that in my experience, few distros have
kept up to date with the portland project scripts.  The ones included
inside gambas are more up to date than several distros.

So:
  Dim tmpfile as String

  tmpfile=Temp$("myPDF.pdf")
  Copy "myPDF.pdf" to tmpfile
  Desktop.Open(tmpfile)


or similar should do the trick
Bruce





More information about the User mailing list