Skip to content

Latest commit

 

History

History
28 lines (24 loc) · 1.35 KB

README.mkd

File metadata and controls

28 lines (24 loc) · 1.35 KB

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.