Skip to content

Commit 172f51c

Browse files
committed
Add get_system_cache_directory to python API
1 parent 64bf95d commit 172f51c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

python/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,19 @@ def connect_vscode_debugger(port=5678):
462462
debugpy.wait_for_client()
463463
execute_on_main_thread(lambda: debugpy.debug_this_thread())
464464

465+
def get_system_cache_directory() -> Optional[str]:
466+
"""
467+
Returns Binary Ninja's system cache directory on the system.
468+
469+
Supported default locations:
470+
- macOS: ~/Library/Caches/Binary Ninja
471+
- Linux: $XDG_CACHE_HOME/Binary Ninja or ~/.cache/Binary Ninja
472+
- Windows: %LOCALAPPDATA%/Binary Ninja/cache
473+
474+
:return: Returns a string containing the system cache directory, or None on failure.
475+
"""
476+
return core.BNGetSystemCacheDirectory()
477+
465478

466479
class UIPluginInHeadlessError(Exception):
467480
"""

0 commit comments

Comments
 (0)