File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -364,7 +364,7 @@ impl File {
364364 }
365365
366366 pub fn tell ( & self ) -> io:: Result < u64 > {
367- unsupported ( )
367+ self . 0 . position ( )
368368 }
369369
370370 pub fn duplicate ( & self ) -> io:: Result < File > {
@@ -747,6 +747,14 @@ mod uefi_fs {
747747 if r. is_error ( ) { Err ( io:: Error :: from_raw_os_error ( r. as_usize ( ) ) ) } else { Ok ( ( ) ) }
748748 }
749749
750+ pub ( crate ) fn position ( & self ) -> io:: Result < u64 > {
751+ let file_ptr = self . protocol . as_ptr ( ) ;
752+ let mut pos = 0 ;
753+
754+ let r = unsafe { ( ( * file_ptr) . get_position ) ( file_ptr, & mut pos) } ;
755+ if r. is_error ( ) { Err ( io:: Error :: from_raw_os_error ( r. as_usize ( ) ) ) } else { Ok ( pos) }
756+ }
757+
750758 pub ( crate ) fn delete ( self ) -> io:: Result < ( ) > {
751759 let file_ptr = self . protocol . as_ptr ( ) ;
752760 let r = unsafe { ( ( * file_ptr) . delete ) ( file_ptr) } ;
You can’t perform that action at this time.
0 commit comments