@@ -14,6 +14,9 @@ use derive_more::Display;
14
14
use uefi:: proto:: media:: file:: { FileAttribute , FileInfo , FileType } ;
15
15
use uefi:: table:: boot:: ScopedProtocol ;
16
16
use alloc:: format;
17
+ use log:: info;
18
+ use uefi:: fs:: path:: Component ;
19
+ use crate :: fs:: path:: Components ;
17
20
18
21
/// All errors that can happen when working with the [`FileSystem`].
19
22
#[ derive( Debug , Clone , Display , PartialEq , Eq ) ]
@@ -108,11 +111,17 @@ impl<'boot_services> FileSystem<'boot_services> {
108
111
let iter = || normalized_path_pathref. components ( NormalizedPath :: SEPARATOR ) ;
109
112
iter ( )
110
113
. 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}" ) ;
113
119
Some ( ( component, path_acc. clone ( ) ) )
114
120
} )
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
+ } )
116
125
}
117
126
118
127
/// Given a path, query the file system to get information about a file,
@@ -193,25 +202,8 @@ impl<'boot_services> FileSystem<'boot_services> {
193
202
194
203
/// Removes a directory at this path, after removing all its contents. Use
195
204
/// 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 ! ( )
215
207
}
216
208
217
209
/// Removes a file from the filesystem.
0 commit comments