NLST supported?

To the Ipswitch web site

Ipswitch Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



NLST supported?Expand / Collapse
Author
Message
Posted 9/7/2004 1:13:28 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/8/2004 2:42:00 PM
Posts: 2, Visits: 1

I am writing a Windows Service in vb.net as part of an FTP interface to a third party company. The Windows Service is designed to download files from the third party company’s ftp server. My code works fine when downloading from their development FTP server, which is running Windows FTP Server. I am running into a problem when I run the service against their production FTP server, which is running WS_FTP 4.0.0.

I am using NLST to get a list of files to download. WS_FTP responds with only one file even though there are many files in the directory.

Is there any work-around for this?

Is NLST fully supported in newer versions of WS_FTP?

Thanks,

Joe

Post #1191
Posted 9/7/2004 4:40:52 PM


Time Traveler

Time TravelerTime TravelerTime TravelerTime TravelerTime TravelerTime TravelerTime TravelerTime Traveler

Group: Moderators
Last Login: 7/16/2008 8:55:05 AM
Posts: 176, Visits: 9
NLST seems to work fine for me. Are you writing the FTP interface from scratch? If so, are you sure that Windows FTP Server and WS_FTP Server aren't sending different new-line delimiters (i.e. "\r" versus just "" or "\r") and you're just trying to handle them the same? It's something to check out, at least. I'm pretty confident you can make it all the way to running an NLST before such a bug would show up in your code, since all the server responses for login are only one line long.





Brandon Felger
IMail Install Developer
Ipswitch
Post #1208
Posted 9/8/2004 2:45:11 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/8/2004 2:42:00 PM
Posts: 2, Visits: 1

Brandon,

I did write this from scratch, along with some code I pulled from someone else.

What I'm doing is, after logging in and changing to the appropriate directory, I open a socket, send the NLST command and the read from the socket.

I don't know if you are familiar with vb.net but I am using the standard socket library.  I am doing a socket.read into a buffer at 513 bytes at a time.  On the Microsoft FTP server I receive a full 513 byte buffer (assuming there are enough files on the server, which in this case there are).  There are 2 bytes delimiting the file names.  On the WS_FTP server I am only receiving 36 bytes.  The first file name is 34 bytes long and 2 bytes for the delimiter.

I don't think I am interpreting the delimiters incorrectly when I p a r s e the buffer because I am only receiving one file name from the socket to begin with.

 

Joe

Post #1237
Posted 9/8/2004 5:07:37 PM


Time Traveler

Time TravelerTime TravelerTime TravelerTime TravelerTime TravelerTime TravelerTime TravelerTime Traveler

Group: Moderators
Last Login: 7/16/2008 8:55:05 AM
Posts: 176, Visits: 9
I don't think I am interpreting the delimiters incorrectly

You already convinced me when you said you were only receiving 36 bytes. If a recv() returns 36 bytes, then 36 bytes is all you got.

Two things that stick out in my mind: (1) the error message returned for not beign able to open a data connection (because WS_FTP Server likes to handle NLST on a data channel) is 33 bytes long, so suspiciously close to 36 I gotta ask if you verified that the 36 bytes received is the first file name. But I only ask "in case"; I'm sure you've looked at that already. The other question I have is whether a subsequent recv() call (or socket.read or whatever you're using) would return the other filenames. Again, I'm guessing not.

Try this: connect to WS_FTP Server using WS_FTP Pro or Home (if you don't have it, download an eval version) and examine (using a tool such as Ethereal) what happens when the client sends an NLST to WS_FTP Server. I'm confident that will give you a better idea of how WS_FTP Server expects an NLST call to be handled.

Of course, you can also purchase this very lovely WS_FTP Pro SDK from us.





Brandon Felger
IMail Install Developer
Ipswitch
Post #1241
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Dave, Mark Singh, kevin r gillis, Jason Benton, Brandon Felger, Ben Henderson, Tripp Allen, Will Sansbury, Jason Williams, Hush, FTPplanet.com, LDW, Hugh Garber, WUP-PM, mmulryan@ipswitch.com, mswimm, Travis G.

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 9:03pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.047. 9 queries. Compression Enabled.