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

Method file_by_path

rust/src/project.rs:648–655  ·  view source on GitHub ↗

Retrieve a file in the project by the `path` on disk

(&self, path: S)

Source from the content-addressed store, hash-verified

646
647 /// Retrieve a file in the project by the `path` on disk
648 pub fn file_by_path<S: BnStrCompatible>(&self, path: S) -> Option<Ref<ProjectFile>> {
649 let path_raw = path.into_bytes_with_nul();
650 let path_ptr = path_raw.as_ref().as_ptr() as *const c_char;
651
652 let result = unsafe { BNProjectGetFileByPathOnDisk(self.handle.as_ptr(), path_ptr) };
653 let handle = NonNull::new(result)?;
654 Some(unsafe { ProjectFile::ref_from_raw(handle) })
655 }
656
657 /// Delete a file from the project
658 pub fn delete_file(&self, file: &ProjectFile) -> bool {

Callers 1

modify_projectFunction · 0.80

Calls 2

into_bytes_with_nulMethod · 0.80
as_refMethod · 0.45

Tested by 1

modify_projectFunction · 0.64