@@ -14,6 +14,9 @@ use derive_more::Display;
1414use uefi:: proto:: media:: file:: { FileAttribute , FileInfo , FileType } ;
1515use uefi:: table:: boot:: ScopedProtocol ;
1616use alloc:: format;
17+ use log:: info;
18+ use uefi:: fs:: path:: Component ;
19+ use crate :: fs:: path:: Components ;
1720
1821/// All errors that can happen when working with the [`FileSystem`].
1922#[ derive( Debug , Clone , Display , PartialEq , Eq ) ]
@@ -108,11 +111,17 @@ impl<'boot_services> FileSystem<'boot_services> {
108111 let iter = || normalized_path_pathref. components ( NormalizedPath :: SEPARATOR ) ;
109112 iter ( )
110113 . scan ( String :: new ( ) , |path_acc, component| {
111- * path_acc += "/" ;
112- * path_acc += format ! ( "{component}" ) . as_str ( ) ;
114+ if component != Component :: RootDir {
115+ * path_acc += "/" ;
116+ * path_acc += format ! ( "{component}" ) . as_str ( ) ;
117+ }
118+ info ! ( "path_acc: {path_acc}, component: {component}" ) ;
113119 Some ( ( component, path_acc. clone ( ) ) )
114120 } )
115- . try_for_each ( |( _component, full_path) | self . create_dir ( full_path. as_str ( ) ) )
121+ . try_for_each ( |( _component, full_path) | {
122+ log:: info!( "fuck this shit! '{full_path}'" ) ;
123+ self . create_dir ( full_path. as_str ( ) )
124+ } )
116125 }
117126
118127 /// Given a path, query the file system to get information about a file,
@@ -193,25 +202,8 @@ impl<'boot_services> FileSystem<'boot_services> {
193202
194203 /// Removes a directory at this path, after removing all its contents. Use
195204 /// carefully!
196- pub fn remove_dir_all ( & mut self , path : impl AsRef < Path > ) -> FileSystemResult < ( ) > {
197- let path = path. as_ref ( ) ;
198- let normalized_path = NormalizedPath :: new ( "\\ " , path) ?;
199- let normalized_path_string = normalized_path. to_string ( ) ;
200- let normalized_path_pathref = Path :: new ( & normalized_path_string) ;
201- let iter = || normalized_path_pathref. components ( NormalizedPath :: SEPARATOR ) ;
202-
203- let paths = iter ( )
204- . scan ( String :: new ( ) , |path_acc, component| {
205- * path_acc += "/" ;
206- * path_acc += format ! ( "{component}" ) . as_str ( ) ;
207- Some ( ( component, path_acc. clone ( ) ) )
208- } )
209- . collect :: < Vec < _ > > ( ) ;
210-
211- paths
212- . iter ( )
213- . rev ( )
214- . try_for_each ( |( _component, full_path) | self . remove_dir ( full_path. as_str ( ) ) )
205+ pub fn remove_dir_all ( & mut self , _path : impl AsRef < Path > ) -> FileSystemResult < ( ) > {
206+ todo ! ( )
215207 }
216208
217209 /// Removes a file from the filesystem.
0 commit comments