Open file with system's default program

guis

#1

Is there a cross platform way to open a file with the system’s default program, basically simulating a double click on the file’s icon?
More specifically, the type of files that will get opened this way is a video file. Instead of building all the GUI involved in making a good video player, I’d let the local system take care of it with whatever solution the user prefers. This way, if the video file can play on their machine, it’ll “play in” my program.


#2

No.


#3

OK…
So nothing like matlab’s winopen (just found it now).

Hmmm…


#4

OO, no idea if this will work, but maybe something like this:

function openit(f::String)
    if is_windows()
        run(`start $f`)
    elseif is_linux()
        run(`xdg-open $f`)
    elseif is_apple()
        run(`open $f`)
    else
        error("Couldn't open $f")
    end
end