module XDG

Extended Modules

Defined in:

helpers.cr
xdg.cr

Instance Method Summary

Instance Method Detail

def cache_file(name : Path | String) : Path | Nil #

The path to the named state file if it exists in XDG::CACHE::HOME ($XDG_CACHE_HOME)


[View source]
def cache_file(name : Path | String, *, binary = false, mode = nil, & : File -> T) forall T #

[View source]
def config_file(name : Path | String) : Path | Nil #

The path to the named config file if it exists in any of XDG::CONFIG::HOME ($XDG_CONFIG_DIRS) or XDG::CONFIG::DIRS ($XDG_CONFIG_DIRS).


[View source]
def config_file(name : Path | String, *, binary = false, mode = nil, & : File -> T) : T forall T #

Open a config file for appending if it exists in any of $XDG_CONFIG_HOME or $XDG_CONFIG_DIRS, otherwise create it. Reads happen from the beggining of the file.


[View source]
def data_file(name : Path | String) : Path | Nil #

The path to the named data file if it exists in any of XDG::DATA::HOME ($XDG_DATA_DIRS) or XDG::DATA::DIRS ($XDG_DATA_DIRS).


[View source]
def data_file(name : Path | String, *, binary = false, mode = nil, & : File -> T) : T forall T #

Open a data file for appending if it exists in any of $XDG_DATA_HOME or $XDG_DATA_DIRS, otherwise create it. Reads happen from the beggining of the file.


[View source]
def state_file(name : Path | String) : Path | Nil #

The path to the named state file if it exists in XDG::STATE::HOME ($XDG_STATE_HOME)


[View source]
def state_file(name : Path | String, *, binary = false, mode = nil, & : File -> T) : T forall T #

Open a state file if it exists in $XDG_STATE_HOME, otherwise create it. Reads happen from the beggining of the file.


[View source]