comply with xdg base directory spec by using XDG_CACHE_HOME if its set

This commit is contained in:
Arthur Deierlein
2024-11-22 11:13:21 +01:00
parent ac482e3e13
commit 1abb4cc881
+5 -1
View File
@@ -6,6 +6,7 @@
Stores all the constant values that are generally fixed throughout
volatility This includes default scanning block sizes, etc.
"""
import enum
import os.path
import sys
@@ -65,7 +66,10 @@ LOGLEVEL_VVV = 7
LOGLEVEL_VVVV = 6
"""Logging level for four levels of detail: -vvvvvv"""
CACHE_PATH = os.path.join(os.path.expanduser("~"), ".cache", "volatility3")
CACHE_PATH = os.path.join(
os.environ.get("XDG_CACHE_HOME") or os.path.expanduser("~/.cache"), "volatility3"
)
"""Default path to store cached data"""
SQLITE_CACHE_PERIOD = "-3 days"