         { "PWD" [ handle-PWD t ] }
         ! { "ABOR" [ ] }
 
-        ! { "SYST" [ drop ] }
+        { "SYST" [ handle-SYST t ] }
         ! { "STAT" [ ] }
         ! { "HELP" [ ] }
 

    [ tokenized>> second <ftp-get> swap fulfill ]
    curry if-command-promise ;

: handle-EPSV ( obj -- )
    drop
    client get command-promise>> [
        "You already have a passive stream" ftp-error
    ] [
        229 "Entering Extended Passive Mode (|||"
        random-local-server
        client get <promise> >>command-promise drop
        [ [ B extended-passive-loop ] curry in-thread ]
        [ addr>> port>> number>string ] bi
        "|)" 3append server-response
    ] if ;



ERROR: type-error type ;

: parse-type ( string -- string' )
    >upper {
        { "IMAGE" [ "Binary" ] }
        { "I" [ "Binary" ] }
        [ type-error ]
    } case ;

: handle-TYPE ( obj -- )
    [
        tokenized>> second parse-type
        200 "Switching to " rot " mode" 3append server-response
    ] [
        2drop "TYPE is binary only" ftp-error
    ] recover ;

: random-local-server ( -- server )
    remote-address get class new 0 >>port binary <server> ;

: port>bytes ( port -- hi lo )
    [ -8 shift ] keep [ HEX: ff bitand ] bi@ ;

: handle-PWD ( obj -- )
    drop
    257 current-directory get "\"" swap "\"" 3append server-response ;

: handle-SYST ( obj -- )
    drop
    215 "UNIX Type: L8" server-response ;

: handle-STOR ( obj -- )
    [
