1 Exported functions
data-home
config-home
cache-home
runtime-dir
data-dirs
config-dirs
2 Development
2.1 Contributing
2.2 Change Log
3 Licence
5.3.6

xdgbasedir

Lawrence Woodman <lwoodman@vlifesystems.com>

This package eases access to the XDG Base Directory Specification. The specification describes a simple and clean way to locate an application’s data, configuration and miscellaneous files. It is a response to the inconsistent mess of files spread all across a file system by many applications.

    1 Exported functions

    2 Development

      2.1 Contributing

      2.2 Change Log

    3 Licence

1 Exported functions

 (require xdgbasedir)

In all the functions below subdir indicates the name of the application that the files relate to.

An exn:fail exception is raised if any of the functions are run on a non-unix system, because the defaults make little sense on these operating systems.

procedure

(data-home subdir)  path?

  subdir : path-string?
Returns the location of user-specific data files.

procedure

(config-home subdir)  path?

  subdir : path-string?
Returns the location of user-specific configuration files.

procedure

(cache-home subdir)  path?

  subdir : path-string?
Returns the location of user-specific non-essential data files.

procedure

(runtime-dir subdir)  (or/c path? boolean?)

  subdir : path-string?
Returns the location of user-specific runtime files. If no directory specified then returns #f.

procedure

(data-dirs subdir)  (listof path?)

  subdir : path-string?
Returns a list of directories, in order of preference, which should be searched for data files.

procedure

(config-dirs subdir)  (listof path?)

  subdir : path-string?
Returns a list of directories, in order of preference, which should be searched for configuration files.

2 Development

2.1 Contributing

If you want to improve this package, make a pull request to the repo on github. Please put any pull requests in a separate branch to ease integration and add a test to prove that it works.

2.2 Change Log

0.3 (30th September 2013)
  • Removes xdgbasedir- prefix from exported functions

0.2.1 (26th August 2013)
  • Various internal structural changes

0.2 (12th August 2013)
  • Raises an exception if run on a non-Unix OS

0.1 (6th August 2013)
  • Initial Release

3 Licence

This software is licensed as follows:

The MIT Licence

Copyright (c) 2013 Lawrence Woodman

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.