From b43c7b4fd71c54794b4f5428ae7533a2999bfcdc Mon Sep 17 00:00:00 2001 From: Alexander Iljin Date: Fri, 17 Jun 2016 02:35:25 +0300 Subject: [PATCH] io.files.info.windows: suppress ERROR_FILE_NOT_FOUND in volume>paths --- basis/io/files/info/windows/windows.factor | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/basis/io/files/info/windows/windows.factor b/basis/io/files/info/windows/windows.factor index fc12f52345..9629253622 100755 --- a/basis/io/files/info/windows/windows.factor +++ b/basis/io/files/info/windows/windows.factor @@ -201,7 +201,7 @@ CONSTANT: names-buf-length 16384 ! Windows may return a volume which looks up to path "" ! For now, treat it like there is not a volume here -: volume>paths ( string -- array ) +: (volume>paths) ( string -- array ) [ names-buf-length [ ushort malloc-array &free ] keep @@ -212,6 +212,14 @@ CONSTANT: names-buf-length 16384 [ { } ] [ [ { 0 } append alien>native-string ] map ] if-empty ] 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." } ! if there is a D: that is not ready, for instance. Ignore these drives. M: windows file-systems ( -- array )