Expand description
Where the player keeps its configuration, caches, durable state, logs, and socket. The daemon and every client resolve these identically, so they always agree on the endpoint and on which files they share.
Every location has an explicit override: $MFP_SOCKET, $MFP_CONFIG_DIR,
$MFP_CACHE_DIR, and $MFP_STATE_DIR. Isolating an instance takes all of them -
scoping the socket alone leaves two daemons writing one state.json and one cache.
Functions§
- audio_
cache_ dir - The directory holding
<identifier>.mp3and<identifier>.mp3.partfiles. - cache_
dir - The directory holding the catalog cache and downloaded audio:
$MFP_CACHE_DIRif set, otherwise~/.cache/mfpon every platform. - catalog_
cache_ file - The normalised JSON document holding the cached catalog.
- config_
dir - The directory holding
config.toml:$MFP_CONFIG_DIRif set, otherwise~/.config/mfpon every platform. - config_
file - The optional configuration file. Its absence is not an error; see
crate::config. - ensure_
socket_ dir - Creates the socket’s parent directory mode
0700, tightening it if it already exists with broader permissions. Fails rather than binding when it belongs to another user, is a symbolic link, or is something other than a directory. - log_
file - The file an autostarted daemon’s output is redirected to, and the path a client names when it reports the daemon as unreachable.
- socket_
path - The Unix domain socket the daemon listens on:
$MFP_SOCKETif set, otherwise$XDG_RUNTIME_DIR/mfp/daemon.sockwhere that variable is set, and$TMPDIR/mfp-$UID/daemon.sockotherwise, with$TMPDIRfalling back to/tmp. - state_
dir - The directory holding
state.jsonanddaemon.log:$MFP_STATE_DIRif set, otherwise~/.local/state/mfpon every platform. - state_
file - The durable listening state file.
- update_
check_ file - What the last version check found, and when. Beside the catalog cache rather than in the state directory: it is a remembered answer that can be deleted at any time, not state the player would miss.