package directories

  1. Overview
  2. Docs
An OCaml library that provides configuration, cache and data paths (and more!) following the suitable conventions on Linux, macOS and Windows

Install

Dune Dependency

Authors

Maintainers

Sources

0.2.tar.gz
sha256=af81e7bd7dd7125eb5168226def47e6e2287f3210ba33c015b58123a1877c40d
sha512=30c0db12eb453f3549bf52c202d6e6a8d12e8f4f07b92d8fc68309beb4dcf66b610eab49ac4bd3e1ddd487cd1539790c92f9511c5c06d33c2bf966148c08aa82

README.md.html

directories

directories is an OCaml library that provides configuration, cache and data paths (and more!) following the suitable conventions on Linux, macOS and Windows. It is inspired by similar libraries for other languages such as directories-jvm.

The following conventions are used:

On Linux and macOS it has no dependency. On Windows, it depends only on ctypes.

Quickstart

You should depend on directories then :

let () =
  let module App_id = struct
    let qualifier = "com"
    let organization = "YourCompany"
    let application = "yourapp"
  end in
  let module M = Directories.Project_dirs (App_id) in
  let option_value = function None -> "None" | Some v -> v in
  Format.printf "cache dir  = `%s`@." (option_value M.cache_dir);
  Format.printf "config dir = `%s`@." (option_value M.config_dir);
  Format.printf "data dir   = `%s`@." (option_value M.data_dir)

For more, have a look at the example folder.

About

OCaml

Innovation. Community. Security.