[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

IO.popen

Eko Budi Setiyo

2/15/2005 1:06:00 AM

Can any body tell me how to convert "Windows command" IO.popen("start
example.pdf") in to Linux or Unix so that the Linux box will open the
"example.pdf" file application.

regards
Eko



5 Answers

craig duncan

2/15/2005 3:40:00 AM

0

Eko Budi Setiyo wrote:
> Can any body tell me how to convert "Windows command" IO.popen("start
> example.pdf") in to Linux or Unix so that the Linux box will open the
> "example.pdf" file application.
>
> regards
> Eko

IO.popen("xpdf example.pdf")

Doesn't "start" on Windows function as sort of a dispatcher? It knows what
application goes with the file type? Linux/Unix doesn't have any such thing
built in AFAIK. You need to run the program that displays the pdf file yourself.


Joel VanderWerf

2/15/2005 4:23:00 AM

0

craig duncan wrote:
> Eko Budi Setiyo wrote:
>
>> Can any body tell me how to convert "Windows command" IO.popen("start
>> example.pdf") in to Linux or Unix so that the Linux box will open the
>> "example.pdf" file application.
>>
>> regards
>> Eko
>
>
> IO.popen("xpdf example.pdf")
>
> Doesn't "start" on Windows function as sort of a dispatcher? It knows
> what application goes with the file type? Linux/Unix doesn't have any
> such thing
> built in AFAIK. You need to run the program that displays the pdf file
> yourself.

KDE has "kfmclient exec URL". Gnome probably has something similar.


Eko Budi Setiyo

2/15/2005 5:41:00 AM

0

craig duncan wrote:

> Eko Budi Setiyo wrote:
>
>> Can any body tell me how to convert "Windows command"
>> IO.popen("start example.pdf") in to Linux or Unix so that the Linux
>> box will open the "example.pdf" file application.
>>
>> regards
>> Eko
>
>
> IO.popen("xpdf example.pdf")
>
> Doesn't "start" on Windows function as sort of a dispatcher? It knows
> what application goes with the file type? Linux/Unix doesn't have any
> such thing
> built in AFAIK. You need to run the program that displays the pdf
> file yourself.
>
>
>
Thanks

I don't know so much about "start" on windows. Personally it's quite
dangerous function. I accidently find it.
Because:

something.exe ---rename---> something.pdf ----> C:\start something.pdf
---> will executed as something.exe



regards
Eko



Eko Budi Setiyo

2/15/2005 5:45:00 AM

0

Joel VanderWerf wrote:

> craig duncan wrote:
>
>> Eko Budi Setiyo wrote:
>>
>>> Can any body tell me how to convert "Windows command"
>>> IO.popen("start example.pdf") in to Linux or Unix so that the Linux
>>> box will open the "example.pdf" file application.
>>>
>>> regards
>>> Eko
>>
>>
>>
>> IO.popen("xpdf example.pdf")
>>
>> Doesn't "start" on Windows function as sort of a dispatcher? It
>> knows what application goes with the file type? Linux/Unix doesn't
>> have any such thing
>> built in AFAIK. You need to run the program that displays the pdf
>> file yourself.
>
>
> KDE has "kfmclient exec URL". Gnome probably has something similar.
>
>
>
Thanks

Is it possible for ruby to find out what is the pdf reader application
installed in the target Computer

regards
Eko



Yohanes Santoso

2/15/2005 8:56:00 AM

0

Eko Budi Setiyo <contact_us@haltebis.com> writes:

> Is it possible for ruby to find out what is the pdf reader application
> installed in the target Computer

In Linux/UNIX? Generally no, unless you know distribution &
installation specific information.

But do try the program "see". It comes from the same package that
provides /etc/mailcap, and so it should be quite common.

Other than that, allow users to specify their own pdf reader.

YS.