 fry alien.strings windows windows.kernel32 windows.time calendar
 combinators math.functions sequences namespaces make words
 symbols system destructors accessors math.bitwise continuations
-windows.errors arrays byte-arrays ;
+windows.errors arrays byte-arrays generalizations ;
 IN: io.windows.files
 
 : open-file ( path access-mode create-mode flags -- handle )

        [ ]
    } cleave ;

M: winnt file-system-info ( path -- file-system-info )
    normalize-path root-directory
    dup [ file-system-type ] [ file-system-space ] bi
    \ file-system-info new
        swap *ulonglong >>free-space
        swap *ulonglong >>total-space
        swap *ulonglong >>available-space
        swap >>type
        swap >>mount-point
    calculate-file-system-info ;


: find-first-file ( path -- WIN32_FIND_DATA handle )
    "WIN32_FIND_DATA" <c-object> tuck
    FindFirstFile
    [ INVALID_HANDLE_VALUE = [ win32-error-string throw ] when ] keep ;

: find-next-file ( path -- WIN32_FIND_DATA/f )
    "WIN32_FIND_DATA" <c-object> tuck
