File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -359,6 +359,25 @@ fn os_stat(path: PyStringRef, vm: &VirtualMachine) -> PyResult {
359
359
}
360
360
}
361
361
362
+ #[ cfg( target_os = "android" ) ]
363
+ fn os_stat ( path : PyStringRef , vm : & VirtualMachine ) -> PyResult {
364
+ use std:: os:: android:: fs:: MetadataExt ;
365
+ match fs:: metadata ( & path. value ) {
366
+ Ok ( meta) => Ok ( StatResult {
367
+ st_mode : meta. st_mode ( ) ,
368
+ st_ino : meta. st_ino ( ) ,
369
+ st_dev : meta. st_dev ( ) ,
370
+ st_nlink : meta. st_nlink ( ) ,
371
+ st_uid : meta. st_uid ( ) ,
372
+ st_gid : meta. st_gid ( ) ,
373
+ st_size : meta. st_size ( ) ,
374
+ }
375
+ . into_ref ( vm)
376
+ . into_object ( ) ) ,
377
+ Err ( s) => Err ( vm. new_os_error ( s. to_string ( ) ) ) ,
378
+ }
379
+ }
380
+
362
381
#[ cfg( windows) ]
363
382
fn os_stat ( path : PyStringRef , vm : & VirtualMachine ) -> PyResult {
364
383
use std:: os:: windows:: fs:: MetadataExt ;
@@ -378,7 +397,12 @@ fn os_stat(path: PyStringRef, vm: &VirtualMachine) -> PyResult {
378
397
}
379
398
}
380
399
381
- #[ cfg( all( not( target_os = "linux" ) , not( target_os = "macos" ) , not( windows) ) ) ]
400
+ #[ cfg( not( any(
401
+ target_os = "linux" ,
402
+ target_os = "macos" ,
403
+ target_os = "android" ,
404
+ windows
405
+ ) ) ) ]
382
406
fn os_stat ( path : PyStringRef , vm : & VirtualMachine ) -> PyResult {
383
407
unimplemented ! ( ) ;
384
408
}
You can’t perform that action at this time.
0 commit comments