How to relocate or inspect the state directory¶
Use WHZBOX_STATE_DIR when you want whzbox to read and write state somewhere other than the default XDG path.
Prerequisites¶
- The
whzboxbinary on yourPATH
Steps¶
1. Override the state directory¶
With this environment variable set, whzbox uses /tmp/whzbox-demo/state.json.
2. Inspect the directory and file permissions¶
When the file exists, the expected permissions are:
- directory:
0700 - file:
0600
3. Inspect the file contents¶
The state file contains the cached Whizlabs session and any cached sandboxes.
Verification¶
Unset the override and compare:
Without the override, whzbox falls back to $XDG_STATE_HOME/whzbox or ~/.local/state/whzbox.
Troubleshooting¶
Problem: the file loads with a permissions error¶
Fix the permissions:
Problem: I want to inspect the default path¶
If XDG_STATE_HOME is unset, the default directory is: