io.files.info.windows: suppress ERROR_FILE_NOT_FOUND in volume>paths
parent
cada98f7d8
commit
b43c7b4fd7
|
@ -201,7 +201,7 @@ CONSTANT: names-buf-length 16384
|
||||||
|
|
||||||
! Windows may return a volume which looks up to path ""
|
! Windows may return a volume which looks up to path ""
|
||||||
! For now, treat it like there is not a volume here
|
! For now, treat it like there is not a volume here
|
||||||
: volume>paths ( string -- array )
|
: (volume>paths) ( string -- array )
|
||||||
[
|
[
|
||||||
names-buf-length
|
names-buf-length
|
||||||
[ ushort malloc-array &free ] keep
|
[ ushort malloc-array &free ] keep
|
||||||
|
@ -212,6 +212,14 @@ CONSTANT: names-buf-length 16384
|
||||||
[ { } ] [ [ { 0 } append alien>native-string ] map ] if-empty
|
[ { } ] [ [ { 0 } append alien>native-string ] map ] if-empty
|
||||||
] with-destructors ;
|
] with-destructors ;
|
||||||
|
|
||||||
|
! Suppress T{ windows-error f 2 "The system cannot find the file specified." }
|
||||||
|
: volume>paths ( string -- array )
|
||||||
|
[ (volume>paths) ] curry
|
||||||
|
[
|
||||||
|
dup { [ windows-error? ] [ n>> ERROR_FILE_NOT_FOUND = ] } 1&&
|
||||||
|
[ drop { } ] [ rethrow ] if
|
||||||
|
] recover ;
|
||||||
|
|
||||||
! Can error with T{ windows-error f 21 "The device is not ready." }
|
! Can error with T{ windows-error f 21 "The device is not ready." }
|
||||||
! if there is a D: that is not ready, for instance. Ignore these drives.
|
! if there is a D: that is not ready, for instance. Ignore these drives.
|
||||||
M: windows file-systems ( -- array )
|
M: windows file-systems ( -- array )
|
||||||
|
|
Loading…
Reference in New Issue