Utilities for working with files and file paths.
This provides a means to access and read files relative to a project. It is useful for loading assets required within a project, and behaves correctly when distributing the project in the form of a dumped lisp image.
Get the path to a directory or file, relative to the project root directory.
(path :some-system "path/to/some/file")
:SOME-SYSTEM is the name of the project's ASDF system. Note that the file is
optional if you just want the absolute path to a directory including the
trailing slash character.
Read a file:
This will read the first s-expression located at "resources/some-resource.lisp", relative to the project root directory. It will not evaluate anything.
Map over a directory's files, performing an effect for all files that match a particular filter:
(map-files "path/to/dir" #'effect :filter #'filter :recursive t)
This will recursively iterate over every file in the given directory, running
EFFECT on each if and only if the function
FILTER must be defined to take one required argument - the
path to the current file.
Copyright © 2015 Michael Fiano email@example.com.
Licensed under the MIT License.
A copy of the license is available here.