Skip to content
A Straightforward Implementation of the XDG Base Directory Specification
Haskell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
System/Environment/XDG
.travis.yml
LICENSE
OutputDirs.hs
README.mkd
Setup.hs
xdg-basedir.cabal

README.mkd

XDG-BaseDir - The XDG Base Directory Specification

This library is, on the whole, trivial. But on the other hand, it is just complex enough for it to look really ugly when these functions have to be recoded time after time for different projects.

All functions in this library take a string representing the name of the program, and return one or more filepaths representing a directory.

  • getUserDataDir :: String -> IO FilePath
  • getUserDataFile :: String -> String -> IO FilePath
  • getUserConfigDir :: String -> IO FilePath
  • getUserConfigFile :: String -> String -> IO FilePath
  • getUserCacheDir :: String -> IO FilePath
  • getUserCacheFile :: String -> String -> IO FilePath
  • getSystemDataDirs :: String -> IO [FilePath]
  • getSystemDataFiles :: String -> String -> IO [FilePath]
  • getSystemConfigDirs :: String -> IO [FilePath]
  • getSystemConfigFiles :: String -> String -> IO [FilePath]
  • getAllDataDirs :: String -> IO [FilePath]
  • getAllDataFiles :: String -> String -> IO [FilePath]
  • getAllConfigDirs :: String -> IO [FilePath]
  • getAllConfigFiles :: String -> String -> IO [FilePath]

The 'Dir' and 'Dirs' variants of the functions return a directory or list of directories, whereas the 'File' and 'Files' functions are simply convenience functions which append a filename to the directories.

You can’t perform that action at this time.