         ] }
     } cond ;
 
+ERROR: nonstring-pathname ;
+ERROR: empty-pathname ;
+
 M: windows-nt-io normalize-pathname ( string -- string )
-    dup string? [ "Pathname must be a string" throw ] unless
-    dup empty? [ "Empty pathname" throw ] when
+    dup string? [ nonstring-pathname ] unless
+    dup empty? [ empty-pathname ] when
     { { CHAR: / CHAR: \\ } } substitute
     cwd swap windows-append-path
     [ "/\\." member? ] right-trim

io.timeouts io.nonblocking io.windows io.windows.nt.backend
kernel libc math threads windows windows.kernel32
alien.c-types alien.arrays sequences combinators combinators.lib
sequences.lib ascii splitting alien strings assocs ;
IN: io.windows.nt.files

M: windows-nt-io cwd


M: windows-nt-io root-directory? ( path -- ? )
    dup length 2 = [
        first2
        [ Letter? ] [ CHAR: : = ] bi* and
    ] [
        drop f
    ] if ;

ERROR: not-absolute-path ;
: root-directory ( string -- string' )
    {
        [ dup length 2 >= ]
        [ dup second CHAR: : = ]
        [ dup first Letter? ]
    } && [ 2 head ] [ not-absolute-path ] if ;

: prepend-prefix ( string -- string' )
    unicode-prefix prepend ;
