Various libraries have a snippet for opening files in external programs using xgd-open (Linux), open (OS X), and cmd.exe (Windows), which are frequently sources of issues which are hard to replicate and track down. I thought this could be centralized in a single package, so I wrote
I tested on Linux, but I need help from testers on Windows and OS X. If you have a minute and you are already using v0.7, please help out by running
julia> DefaultApplication.test()
β Info: opening text file with the default application
β path = β/var/folders/fb/m164mwfn3v1btnrpmmyzpvqh0000gn/T/juliaXPmD7d.txtβ
β Info: If the file was not opened, please copy the output and open an issue at
β Issues Β· tpapp/DefaultApplication.jl Β· GitHub
β KERNEL = :Darwin
β VERSION = v"0.7.0-beta2.15"
Process(open /var/folders/fb/m164mwfn3v1btnrpmmyzpvqh0000gn/T/juliaXPmD7d.txt, ProcessExited(0))
and TextEdit appears.
julia> versioninfo()
Julia Version 0.7.0-beta2.15
Commit 199b74e853* (2018-07-16 12:23 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin17.7.0)
CPU: Intel(R) Coreβ’ i5-6267U CPU @ 2.90GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
Environment:
JULIA_PKG3_PRECOMPILE = true
JULIA_EDITOR = see
JULIA_SVG_BROWSER = Google Chrome.app
julia> import DefaultApplication
julia> DefaultApplication.test()
β Info: opening text file with the default application
β path = "C:\\Users\\username\\AppData\\Local\\Temp\\1\\jl_483D.tmp.txt"
β Info: If the file was not opened, please copy the output and open an issue at
β https://github.com/tpapp/DefaultApplication.jl/issues
β KERNEL = :NT
β VERSION = v"0.7.0-beta2.0"
β Info: Version information for windows
β windows_version = v"10.0.16299"
Process(`'C:\WINDOWS\system32\cmd.exe' /c start 'C:\Users\username\AppData\Local\Temp\1\jl_483D.tmp.txt'`, ProcessExited(0))
version details:
julia> versioninfo()
Julia Version 0.7.0-beta2.0
Commit b145832402* (2018-07-13 19:54 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Xeon(R) CPU E5-2640 v3 @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, haswell)
On Windows 10
julia> versioninfo()
Julia Version 0.7.0-beta2.0
Commit b145832402* (2018-07-13 19:54 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
EDIT: my bad, it was the pasted expression that caused the error. The notepad opened okay.
julia> julia> DefaultApplication.test()
β Info: opening text file with the default application
β path = "C:\\Users\\PETRKR~1\\AppData\\Local\\Temp\\jl_A44.tmp.txt"
β Info: If the file was not opened, please copy the output and open an issue at
β https://github.com/tpapp/DefaultApplication.jl/issues
β KERNEL = :NT
β VERSION = v"0.7.0-beta2.12"
β Info: Version information for windows
β windows_version = v"10.0.17134"
ERROR: UndefVarError: julia not defined
Stacktrace:
[1] top-level scope at none:0