lambdabot-core-5.2: Lambdabot core functionality

Lambdabot.File

Description

Manage lambdabot's state files. There are three relevant directories:

• local: .State (configurable, see outputDir)
• home: ~.lambdabotState/
• data: relative to the data directory of the lambdabot package.

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.

Synopsis

# Documentation

Locate state directory. Returns the local directory if it exists, and the home directory otherwise.

Look for the file in the local, home, and data directories.

Return file name for writing state. The file will reside in the state directory (stateDir), and findLBFileForWriting ensures that the state directory exists.

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.

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)