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 > {
@@ -734,6 +734,14 @@ mod uefi_fs {
734734 if r. is_error ( ) { Err ( io:: Error :: from_raw_os_error ( r. as_usize ( ) ) ) } else { Ok ( ( ) ) }
735735 }
736736
737+ pub ( crate ) fn position ( & self ) -> io:: Result < u64 > {
738+ let file_ptr = self . protocol . as_ptr ( ) ;
739+ let mut pos = 0 ;
740+
741+ let r = unsafe { ( ( * file_ptr) . get_position ) ( file_ptr, & mut pos) } ;
742+ if r. is_error ( ) { Err ( io:: Error :: from_raw_os_error ( r. as_usize ( ) ) ) } else { Ok ( pos) }
743+ }
744+
737745 pub ( crate ) fn delete ( self ) -> io:: Result < ( ) > {
738746 let file_ptr = self . protocol . as_ptr ( ) ;
739747 let r = unsafe { ( ( * file_ptr) . delete ) ( file_ptr) } ;
You can’t perform that action at this time.
0 commit comments