Skip to content

willdonnelly/xdg-basedir

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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