MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / download_file

Function download_file

python/collaboration/databasesync.py:46–60  ·  view source on GitHub ↗

Download a file from its remote, saving all snapshots to a database in the specified location. Returns a FileContext for opening the file later. :param file_: Remote File to download and open :param db_path: File path for saved database :param progress: Function to call for progress updates

(file_: 'file.RemoteFile', db_path: str, progress: 'util.ProgressFuncType' = util.nop)

Source from the content-addressed store, hash-verified

44
45
46def download_file(file_: 'file.RemoteFile', db_path: str, progress: 'util.ProgressFuncType' = util.nop) -> 'FileMetadata':
47 """
48 Download a file from its remote, saving all snapshots to a database in the
49 specified location. Returns a FileContext for opening the file later.
50
51 :param file_: Remote File to download and open
52 :param db_path: File path for saved database
53 :param progress: Function to call for progress updates
54 :return: FileContext for opening
55 :raises RuntimeError: If there was an error
56 """
57 value = core.BNCollaborationDownloadFile(file_._handle, db_path, util.wrap_progress(progress), None)
58 if value is None:
59 raise RuntimeError(util._last_error())
60 return FileMetadata(handle=ctypes.cast(value, core.BNFileMetadataHandle))
61
62
63def upload_database(metadata: 'FileMetadata', project: 'project.RemoteProject', parent_folder: Optional['folder.RemoteFolder'] = None, progress: 'util.ProgressFuncType' = util.nop, name_changeset: 'util.NameChangesetFuncType' = util.nop) -> 'file.RemoteFile':

Callers

nothing calls this directly

Calls 1

FileMetadataClass · 0.50

Tested by

no test coverage detected