pub fn from_meta(tsk_fs: &'fs TskFs, inode: u64) -> Result<TskFsFile, TskError> {
        // Get a pointer to the TSK_FS_FILE sturct
        let tsk_fs_file_ptr = unsafe {tsk::tsk_fs_file_open_meta(
            tsk_fs.into(),
            null_mut(),
            inode as _
        )};

        if tsk_fs_file_ptr.is_null() {
            // Get a ptr to the error msg
            let error_msg_ptr = unsafe { tsk::tsk_error_get() };
            // Get the error message from the string
            let error_msg = unsafe { CStr::from_ptr(error_msg_ptr) }.to_string_lossy();
            // Return an error which includes the TSK error message
            return Err(TskError::lib_tsk_error(
                format!("There was an error opening inode {}: {}", inode, error_msg)
            ));
        }

        Ok( Self { 
            tsk_fs_info_ptr: tsk_fs.into(),
            tsk_fs_file_ptr, 
            _release: true
        } )
    }
/// Create a TSK_FS_FILE wrapper given TskFs and inode
Create a TSK_FS_FILE wrapper given TskFs and inode
Create a TSK_FS_FILE wrapper given TskFs and inode
pub fn from_meta(tsk_fs: &'fs TskFs, inode: u64) -> Result<TskFsFile, TskError> {
        // Get a pointer to the TSK_FS_FILE sturct
        let tsk_fs_file_ptr = unsafe {tsk::tsk_fs_file_open_meta(
            tsk_fs.into(),
            null_mut(),
            inode as _
        )};
        if tsk_fs_file_ptr.is_null() {
            // Get a ptr to the error msg
            let error_msg_ptr = unsafe { tsk::tsk_error_get() };
            // Get the error message from the string
            let error_msg = unsafe { CStr::from_ptr(error_msg_ptr) }.to_string_lossy();
            // Return an error which includes the TSK error message
            return Err(TskError::lib_tsk_error(
                format!("There was an error opening inode {}: {}", inode, error_msg)
            ));
        }
        Ok( Self { 
            tsk_fs_info_ptr: tsk_fs.into(),
            tsk_fs_file_ptr, 
            _release: true
        } )
    }
pub fn from_meta ( tsk_fs : & ' fs TskFs , inode : u64 ) -> Result < TskFsFile , TskError > { // Get a pointer to the TSK_FS_FILE sturct let tsk_fs_file_ptr = unsafe { tsk :: tsk_fs_file_open_meta ( tsk_fs . into ( ) , null_mut ( ) , inode as _ ) } ; if tsk_fs_file_ptr . is_null ( ) { // Get a ptr to the error msg let error_msg_ptr = unsafe { tsk :: tsk_error_get ( ) } ; // Get the error message from the string let error_msg = unsafe { CStr :: from_ptr ( error_msg_ptr ) } . to_string_lossy ( ) ; // Return an error which includes the TSK error message return Err ( TskError :: lib_tsk_error ( format ! ( " " inode error_msg ) ) ) ; } Ok ( Self { tsk_fs_info_ptr : tsk_fs . into ( ) , tsk_fs_file_ptr , _release : true } ) }
Create a TSK_FS_FILE wrapper given TskFs and inode
Create a TSK_FS_FILE wrapper given TskFs and inode
tsk_fs
&'fs TskFs
inode
u64