I am using the ftp command in windows and solaris as the client. The log file is attached for the ls -l command from the ftp terminal. While debugging, the found that the command sent is NLST -l, which in turn lists the directory in the NLIST_FORMAT correctly, but the '-l' parameter is somehow translated as the remote directory parameter. I built the apache ftp server code taken from the 1.4 branch in Nov 2007. The result is the same even without my tweaked code. ie; with the plain apache ftpserver code, an ls -l gives the same result.
Thanks Ajith -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Niklas Gustavsson Sent: Wednesday, February 13, 2008 7:10 AM To: ftpserver-dev@incubator.apache.org Subject: Re: problem with DataConnection.transferToClient(outputStr); What client are you using for testing? Can you repeat this behavior with any client? Could you provide the deb level log from the server? /niklas On Feb 11, 2008 10:41 PM, Janardhanan, Ajith (AJANARDH) <[EMAIL PROTECTED]> wrote: > I have the Apache ftp server embedded in my code and tweaked the code > to add a new onListStart() command. In the onListStart(), when the > user does an 'ls -l' command, I display a list, without actually going > in to the filesystem: > > eg: > > ftp> ls -l > 200 PORT command successful > 150 Opening ASCII mode data connection for file list. > 200 PORT command successful > 150 Opening ASCII mode data connection for file list. > -rw-r--r-- 1 ajith ftpctrl 128000 Feb 05 16:55 > fileDOJ7gd.1202230507 > -rw-r--r-- 1 ajith ftpctrl 7982 Feb 07 14:33 > filenmfTNr.1202394783 > 226 Transfer Complete > remote: incoming > 1125 bytes received in 0.026 seconds (42.82 Kbytes/s) > 226 Transfer Complete > remote: -l > 1125 bytes received in 0.026 seconds (42.82 Kbytes/s) > > > > In my code, this is what I am doing: > > public FtpletEnum onDirStart(FtpSession session, FtpRequest request, > FtpReplyOutput response) > { > String outputStr = "-rw-r--r-- 1 ajith ftpctrl 128000 Feb 05 16:55 > fileDOJ7gd.1202230507\n > -rw-r--r-- 1 ajith ftpctrl 7982 Feb 07 14:33 > filenmfTNr.1202394783\n"; > > DataConnection dataConnection =null; > response.write(new DefaultFtpReply(150, "Opening ASCII mode data > connection for file list.")); dataConnection = > session.getDataConnection().openConnection(); > dataConnection.transferToClient(outputStr); > response.write(new DefaultFtpReply(226, "Transfer Complete")); } > > > Any idea who puts in the remote: -l line, I want to get rid of the > line in the user terminal. > > Any help appreciated > > Thanks > Ajith >