summaryrefslogtreecommitdiff
path: root/python/__init__.py
diff options
context:
space:
mode:
authorAlexander Khosrowshahi <alexk@vector35.com>2025-07-09 12:05:31 -0400
committerAlexander Khosrowshahi <alexk@vector35.com>2025-07-09 12:05:31 -0400
commitbeda6059f236f08d7179b7346655d19aaa47dd26 (patch)
tree38d2cb086bc6bea4c2ab608628cd636303297d3f /python/__init__.py
parent44e415514493ec30bb4066e8d2224be032ee8308 (diff)
Add get_system_cache_directory and GetSystemCacheDirectory to API
Diffstat (limited to 'python/__init__.py')
-rw-r--r--python/__init__.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/__init__.py b/python/__init__.py
index 59549b85..77c64fce 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -461,6 +461,19 @@ def connect_vscode_debugger(port=5678):
debugpy.wait_for_client()
execute_on_main_thread(lambda: debugpy.debug_this_thread())
+def get_system_cache_directory() -> Optional[str]:
+ """
+ Returns Binary Ninja's system cache directory on the system.
+
+ Supported default locations:
+
+ - macOS: ~/Library/Caches/Binary Ninja
+ - Linux: $XDG_CACHE_HOME/Binary Ninja or ~/.cache/Binary Ninja
+ - Windows: %LOCALAPPDATA%/Binary Ninja/cache
+
+ :return: Returns a string containing the system cache directory, or None on failure.
+ """
+ return core.BNGetSystemCacheDirectory()
class UIPluginInHeadlessError(Exception):
"""