package xdg

  1. Overview
  2. Docs
XDG Base Directory Specification

Install

dune-project
 Dependency

Authors

Maintainers

Sources

dune-3.22.0.tbz
sha256=cb816b2e672ca6c6ea680133f01287bd95a58ca611cb476acff67b8adbacf722
sha512=c99102070a9c90b29ca4cac68bd2444c086dd0ac5b63515d561087509beff719c4c534ee844f25ce391d1c08080f9e78b7dd32ed14057c6b9cc7886f60337f3b

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.