Based on earlier Julia users threads. This may no longer be compatible with 
0.3.11 and may be shortened.


println(".juliarc define function: lastfile()  ")
"
Name of last file in current directory
"
function lastfile()
#Name of last file in current directory
rd=readdir(pwd())
rd[indmax(map(mtime,rd))]
end

if VERSION >= v"0.4.0-dev+6521"
println("    osol()  osopen()")

"
Windows or Mac, open the given file in current directory
"
function osopen(filename::AbstractString)
# open the file on Mac or on Windows
@osx? run(`open $filename`) : spawn(`cmd /C "$filename"`)
end


"
Windows or Mac, open the last file in current directory
"
function osol()
filename=lastfile()
@osx? run(`open $filename`) : spawn(`cmd /C "$filename"`)
end


Reply via email to