package xdg

  1. Overview
  2. Docs
XDG Base Directory Specification

Install

dune-project
 Dependency

Authors

Maintainers

Sources

dune-3.21.0.tbz
sha256=e76d4d89368a0a70025193aeaf4f7c5b54031dba3f59bf9d2af1971dc0eceddd
sha512=a7531de073a47f644bd1e06bfb424c50a61d34245e5e0a1f32d8da920437e8fe59246304cb7aec25f797a8dafea876feceeccfe5139502ead4d1ba5c45773ef3

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.