Skip to content

A Straightforward Implementation of the XDG Base Directory Specification

License

Notifications You must be signed in to change notification settings

willdonnelly/xdg-basedir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A Straightforward Implementation of the XDG Base Directory Specification

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •