mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-18 01:13:30 -05:00
fix: hold data directories while packs read them
This commit is contained in:
1 parent
d98f00cfbc
commit
1ffc0a6937
5 files changed
+101
-3
No files matched your search
+11
-2
@@ -716,8 +716,17 @@ _data_dir_index: dict[str, dict[str, list[tuple[int, str]]]] = {}
|
||||
|
||||
|
||||
def _data_dir_basenames(cache_dir: str) -> dict[str, list[tuple[int, str]]]:
|
||||
"""Casefolded basename -> (walk order, path) of every file in a cache."""
|
||||
key = os.path.realpath(cache_dir)
|
||||
"""Casefolded basename -> (walk order, path) of every file in a cache.
|
||||
|
||||
Keyed by the tree's identity as well as its path: a refresh swaps in a
|
||||
new directory under the same name, and an index of the old one named
|
||||
files that were gone.
|
||||
"""
|
||||
try:
|
||||
stat = os.stat(cache_dir)
|
||||
except OSError:
|
||||
return {}
|
||||
key = f"{os.path.realpath(cache_dir)}:{stat.st_dev}:{stat.st_ino}"
|
||||
if key not in _data_dir_index:
|
||||
index: dict[str, list[tuple[int, str]]] = {}
|
||||
order = 0
|
||||
|
||||
Reference in new issue
Block a user