Skip to main content

Thread: Open files with default program


i'm making java-app should able open different files using users preferred application particular filetype. example, if user has set "open with" in nautilus .odt files oowriter program should used open file.

in windows, can call runtime.exec("document.odt"); , os recognize file not executable , instead launch program associated file-type. in mac osx (i've been told), should call runtime.exec("open document.odt");

do in linux? of course, best thing reuse nautilus filetype associations (the "open with"-tab) - if current x-session running gnome, , konqueror's ditto if we're in kde etc.

there program available?

code:
xdg-open document.odt
from http://portland.freedesktop.org/wiki/ should installed on ubuntu, , linux.

ps:
have
code:
alias o="xdg-open"
in bashrc, bash can do
code:
o filename


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Open files with default program


Ubuntu

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'