pub fn from_fs_offset(tsk_img: &TskImg, offset: u64) -> Result<TskFs, TskError> {
        // Get a pointer to the TSK_FS_INFO sturct
        let tsk_fs_ptr = unsafe {tsk::tsk_fs_open_img(
            tsk_img.handle.as_ptr(),
            offset as i64 as _,
            0
        )};

        if tsk_fs_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 the fs handle at offset {}: {}", offset, error_msg)
            ));
        }

        Ok( Self { tsk_fs_ptr, _release: true } )
    }
/// Create a TSK_FS_INFO wrapper given the TskImg and offset of the file system
Create a TSK_FS_INFO wrapper given the TskImg and offset of the file system
Create a TSK_FS_INFO wrapper given the TskImg and offset of the file system
pub fn from_fs_offset(tsk_img: &TskImg, offset: u64) -> Result<TskFs, TskError> {
        // Get a pointer to the TSK_FS_INFO sturct
        let tsk_fs_ptr = unsafe {tsk::tsk_fs_open_img(
            tsk_img.handle.as_ptr(),
            offset as i64 as _,
            0
        )};
        if tsk_fs_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 the fs handle at offset {}: {}", offset, error_msg)
            ));
        }
        Ok( Self { tsk_fs_ptr, _release: true } )
    }
pub fn from_fs_offset ( tsk_img : & TskImg , offset : u64 ) -> Result < TskFs , TskError > { // Get a pointer to the TSK_FS_INFO sturct let tsk_fs_ptr = unsafe { tsk :: tsk_fs_open_img ( tsk_img . handle . as_ptr ( ) , offset as i64 as _ , 0 ) } ; if tsk_fs_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 ! ( " " offset error_msg ) ) ) ; } Ok ( Self { tsk_fs_ptr , _release : true } ) }
Create a TSK_FS_INFO wrapper given the TskImg and offset of the file system
Create a TSK_FS_INFO wrapper given the TskImg and offset of the file system
tsk_img
&TskImg
offset
u64