package xdg

  1. Overview
  2. Docs
XDG Base Directory Specification

Install

dune-project
 Dependency

Authors

Maintainers

Sources

dune-3.20.2.tbz
sha256=b1a86b2d60bdb4a8b9bb6861bdf2f9f28a6e7cb5d833ce81afecceb9ef9ca549
sha512=ed14df9163e487d4ae7d0a2427eaab7823ef1f0ef2d93f0b783e6f163bbd5b44ba73f055d60b84e76f476fe11d38e794013628a1da776d9ec13cca9666e7b7ff

doc/index.html

xdg - the XDG base directories specification

Introduction

Where should your application put its files? Somewhere in $HOME? Do non-Unix systems have something like that? What about cache files?

Fortunately, there is a standard for this - the XDG base directories specification.

This library implements this standard and extends it in a way that works on Windows too.

Example

This computes the name of a config file for a program named acme.

  let config_file_path =
    let xdg = Xdg.create ~env:Sys.getenv_opt () in
    let config_dir = Xdg.config_dir xdg in
    Filename.concat config_dir "acme"

API documentation

The entry point for this library is Xdg.