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?
from http://portland.freedesktop.org/wiki/ should installed on ubuntu, , linux.code:xdg-open document.odt
ps:
have
in bashrc, bash can docode:alias o="xdg-open"
code:o filename
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Open files with default program
Ubuntu
Comments
Post a Comment