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

Method get_file_by_name

python/collaboration/project.py:339–360  ·  view source on GitHub ↗

Get a specific File in the Project by its name .. note:: If the project has not been opened, it will be opened upon calling this. .. note:: If files have not been pulled, they will be pulled upon calling this. :param name: Name of File :return: File object, if one with that name exists

(self, name: str)

Source from the content-addressed store, hash-verified

337 return file.RemoteFile(value)
338
339 def get_file_by_name(self, name: str) -> Optional['file.RemoteFile']:
340 """
341 Get a specific File in the Project by its name
342
343 .. note:: If the project has not been opened, it will be opened upon calling this.
344
345 .. note:: If files have not been pulled, they will be pulled upon calling this.
346
347 :param name: Name of File
348 :return: File object, if one with that name exists. Else, None
349 :raises: RuntimeError if there was an error pulling files
350 """
351 if not self.open():
352 raise RuntimeError("Failed to open project")
353
354 if not self.has_pulled_files:
355 self.pull_files()
356
357 value = core.BNRemoteProjectGetFileByName(self._handle, name)
358 if value is None:
359 return None
360 return file.RemoteFile(value)
361
362 def pull_files(self, progress: 'util.ProgressFuncType' = util.nop):
363 """

Callers 1

mainFunction · 0.45

Calls 3

openMethod · 0.95
pull_filesMethod · 0.95
RemoteFileMethod · 0.80

Tested by

no test coverage detected