| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Lambdabot.File
Description
Manage lambdabot's state files. There are three relevant directories:
- local:
.State(configurable, seeoutputDir) - home:
~.lambdabotState/ - data: relative to the data directory of the
lambdabotpackage.
Files are stored locally if the directory exists; otherwise, in the home directory. When reading a state file, and the file exists in the data directory but nowhere else, then it is picked up from the data directory.
Documentation
Locate state directory. Returns the local directory if it exists, and the home directory otherwise.
findLBFileForReading :: FilePath -> LB (Maybe FilePath) #
Look for the file in the local, home, and data directories.
findLBFileForWriting :: FilePath -> LB FilePath #
Return file name for writing state. The file will reside in the
state directory (stateDir), and findLBFileForWriting ensures that
the state directory exists.
findOrCreateLBFile :: FilePath -> LB String #
This returns the same file name as findLBFileForWriting.
If the file does not exist, it is either copied from the data (or home)
directory, if a copy is found there; otherwise, an empty file is
created instead.
findLBFile :: FilePath -> LB (Maybe String) #
Deprecated: Use findLBFileForReading or findLBFileForWriting instead
Try to find a pre-existing file, searching first in the local or home directory (but not in the data directory)