package open
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=a4e248163b215e70035bc7f387c32f8d34d1f2594a65a2a1a5eda1fff4a0fb38
md5=3cd2b960c7f7d035ca650b3a9af2cb01
doc/README.html
ocaml-open
Conveniently open files such as PDFs in their default applications straigt from OCaml.
Quick start
You can install the library using opam:
$ opam install openThen in utop or ocaml,
$ ocaml
> #require "open";;
> Open.in_default_app "/home/steffen/ocaml.svg";;
- : bool = trueThe boolean returned by Open.in_default_app indicates whether the open command exited normally:
> Open.in_default_app "/path/to/non-existent.file";;
- : bool = falseAPI
The tiny API is documented here.
Building from source
Dependencies
The library requires dune (formerly known as jbuilder) to build, but has no other dependencies.
Building Library and Examples
Run make to build and make test to see the library in action. This should open several files from the examples/basic folder.
There is also a more sophisticated example in examples/graphviz that requires graphivz and Jane Street's core (version v0.9.0 or higher). You can build & run it as follows:
jbuilder build @graphvizLimitations and Implementation
The library has been tested under Linux and MacOS. There is experimental support for Windows/Cygwin, but this is untested. The implementation uses xdg-open on Linux, open on MacOS, and cmd start on Windows.
Suggestion and Contributions
Suggestions and contributions are always welcome. Feel free to submit pull requests.