]> gitweb.factorcode.org Git - factor.git/commitdiff
io.files.info: On my Windows7 box, D: is "not really there" and it kills
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 17 Sep 2012 00:23:25 +0000 (17:23 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 17 Sep 2012 00:23:25 +0000 (17:23 -0700)
file-systems. Ignore errors instead of dying.

basis/io/files/info/windows/windows.factor

index 3b349403d0fe9132c06ba453f365435e6515aff4..a16461bb2be8181df1f0cb3a7c699c5e681a98c3 100755 (executable)
@@ -182,10 +182,12 @@ CONSTANT: names-buf-length 16384
         [ { } ] [ [ alien>native-string ] map ] if-empty
     ] with-destructors ;
 
+! 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 )
     find-volumes [ volume>paths ] map concat [
-        (file-system-info)
-    ] map ;
+        [ (file-system-info) ] [ 2drop f ] recover
+    ] map sift ;
 
 : file-times ( path -- timestamp timestamp timestamp )
     [