inets/ftp error parsing response to ftp:nlist/1

Serge Aleynikov <>
Wed May 3 23:37:47 CEST 2006


I believe there's a bug in the ftp:nlist/1 error response parser.  A 
call to this function in an empty remote directory results in the 
following response:  {error, " No files found\r\n"} instead of
{error, Atom}, where Atom would be known to ftp:formaterror/1.

Here's a trace that shows the 'trans_neg_compl' status is not being 
hangled separately by ftp:ctrl_result_response:

5> ftp:nlist(Pid).
"Sending: EPSV"
"Receiving: 229 Entering Extended Passive Mode (|||39641|)"
"ASYNC CONNECT SUCCESSFUL, WAITING FOR COMPLETION"
"Sending: NLST"
"Receiving: 450 No files found"
(<0.44.0>) call 
ftp:ctrl_result_response(trans_neg_compl,{state,#Port<0.111>,
        #Port<0.115>,
        true,
        "/home/timocl/Projects/EOTP/current",
        ftp_server_default,
        false,
        passive,
        60000,
        <<"">>,
        {<<"">>,[],start},
        <0.32.0>,
        {<0.32.0>,#Ref<0.0.0.151>},
        {dir,[]},
        false,
        ignore},{error," No files found\r\n"})
(<0.44.0>) returned from ftp:ctrl_result_response/3 ->
     {noreply,
        {state,
            #Port<0.111>,
            #Port<0.115>,
            true,
            "/home/timocl/Projects/EOTP/current",
            ftp_server_default,
            false,
            passive,
            60000,
            <<"">>,
            {<<"">>,[],start},
            <0.32.0>,
            undefined,
            undefined,
            false,
            ignore}}
{error," No files found\r\n"}

-- 
Serge Aleynikov
R&D Telecom, IDT Corp.
Tel: (973) 438-3436
Fax: (973) 438-1464




More information about the erlang-questions mailing list