package xdg

  1. Overview
  2. Docs
XDG Base Directory Specification

Install

dune-project
 Dependency

Authors

Maintainers

Sources

dune-3.22.1.tbz
sha256=0c0b98396c32ec426886c2c2294024fd687ac5114d4dda0af9dc8a2e584d47fd
sha512=4dc4ed45fb52a3017bc73fdbcb7b88c1710cebfdbb87ecb6f933582f8f0a27ef740f8c4009439ff6a878e1115c3f29d199e63d0367a88a09d2ea19b61517a814

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.