You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Steve Loughran <st...@iseran.com> on 2000/11/07 21:37:12 UTC

Thoughts on an 'open' task

I seem to have need of an 'open' task in some of my targets which would take
a file and based on its type bring it up in the appropriate app. For
example, <open file="results.html" wait="false"> would spawn a viewer for an
HTML file without caring what the reference viewer app is.

Doing that on Windows is fairly easy with a 10 line wrapper application
"open.exe" to do the right thing. But I wouldnt know where to begin on
Unix/Linux/Mac.

If there is a solution to doing it on most platforms then it would make
sense for me to turn it into a re-usable task, otherwise it might as well
remain a single platform trick I can do using exec.

Any suggestions for cross platform solutions?

    -Steve


Re: Thoughts on an 'open' task

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "PD" == Peter Donald <do...@apache.org> writes:

 PD> If KDE and Mac platforms had equivelent then we could do such a
 PD> thing I believe.

KDE has AFAIK, but what are you going to do with people like me? Linux
with sawmill - no GNOME (at least not configured), no KDE. At home it
is fvwm2 and no fancy desktop stuff at all.

On Unix systems one could consult /etc/mailcap, relying on metamail
for Unix might be better than relying on GNOME/KDE. On the other hand
this file lists lots of applications that I have not installed on my
system.

The best cross platform solution I can think of is starting a browser,
lynx, Netscape, Emacs-W3 usually know how to handle any mime-type on
earth.

Stefan

Re: Thoughts on an 'open' task

Posted by Peter Donald <do...@apache.org>.
At 12:37  7/11/00 -0800, you wrote:
>I seem to have need of an 'open' task in some of my targets which would take
>a file and based on its type bring it up in the appropriate app. For
>example, <open file="results.html" wait="false"> would spawn a viewer for an
>HTML file without caring what the reference viewer app is.
>
>Doing that on Windows is fairly easy with a 10 line wrapper application
>"open.exe" to do the right thing. But I wouldnt know where to begin on
>Unix/Linux/Mac.

can also call start.exe on windows. For someplatform/windows environments I
know there is an equivelent. GNOME has a mime type registry and can launch
apps from. If KDE and Mac platforms had equivelent then we could do such a
thing I believe. Thou it may be better to have it look like

<open url="file:results.html" mimetype="text/html" wait="false" />

The mimetype would only be for systems that can not auto guess mimetype
based on extention.

>If there is a solution to doing it on most platforms then it would make
>sense for me to turn it into a re-usable task, otherwise it might as well
>remain a single platform trick I can do using exec.
>
>Any suggestions for cross platform solutions?

I don't know how to do it but it could be done ;)

Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*