xdg_data_home: Get XDG_DATA_HOME

View source: R/path.R

xdg_data_homeR Documentation

Get XDG_DATA_HOME

Description

Return value for XDG_DATA_HOME as defined by the XDG Base Directory Specification

Usage

xdg_data_home(sep = "/", fallback = normalizePath(getwd(), winslash = sep))

Arguments

sep

Path separator to be used on Windows

fallback

Value to return as fallback (see details)

Value

The following algorithm is used to determine the returned path:

  1. If environment variable (EV) ⁠$XDG_DATA_HOME⁠ exists, return its value

  2. Else, if EV ⁠$HOME⁠ exists, return ⁠$HOME/.local/share⁠

  3. Else, if EV ⁠$USERPROFILE⁠ exists, return ⁠$USERPROFILE/.local/share⁠

  4. Else, return ⁠$fallback⁠

See Also

xdg_config_home()

Examples

xdg_data_home()

toscm/toscutil documentation built on Feb. 23, 2025, 2:20 p.m.