Archived

This topic is now archived and is closed to further replies.

writing an FTP client

This topic is 5128 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I needed some FTP functionality in my proggie, so I decide to use winInet library. BOOM! its crap! don''t use it. So after searching the net for some soft of freeware FTP library I cant find one, so what do I do then? I decide to write my own. Anyway, without boring you guys with my life story, heres my question: Ive noticed on some FTP servers, at certain times, such as at login, and right after a file transfer, It will send like 3 lines, then a short pause , then some more lines, before its ready for the next command. This bugs the hell out of me, because it means my program has to wait an arbitrary amount of time (usually about 5 seconds to be safe), if it doesnt send more lines. Does anybody know if theres a way of detecting if there''s more data to be recv''d in such a scenario? This is really annoying, because if i am transferring a large amount of small files, that translates into a LOT of unnecessary waiting. I probably should stop, My doctor says I have the wrists of an 80-year old

Share this post


Link to post
Share on other sites
i got that RFC.. thats what ive been using! however its very long and i really havent got time to be reading the entire thing just to find something that probably isnt even in there

Share this post


Link to post
Share on other sites
I think you''ll find that if a response line isn''t the last one, the number will be followed by a hyphen (-). The final line will have no hyphen, do you don''t need to wait an arbitrary amount of time.

PS. If you are not writing software according to the standards, please don''t connect to my FTP server.



"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan

Share this post


Link to post
Share on other sites
quote:
Original post by JY
PS. If you are not writing software according to the standards, please don''t connect to my FTP server.



FTP is one of the worst "standards" still in use today. The directory listing command alone is so ambiguous that every major GUI FTP client in use today has at least 5 seperate ways of handling its output just so that it will work with all the major FTP servers. I guess that''s what you get when you let a bunch of university Unix heads who''ve never been in the real world design a protocol.

Share this post


Link to post
Share on other sites
quote:
Original post by Arild Fines
Didn''t FTP precede UNIX?


They came around at about the same time (UNIX was 1969 if you ask Bell Labs, 1974 if you ask someone that doesn''t like Bell Labs), and FTP was officially drawn up in 1973. Though I wasn''t actually being literal, in fact the type of UNIX head I was talking about didn''t really become an identifiable entity for another 5 or 6 years. By UNIX head I''m referring to the kind of person (normally in a university poking away at a UNIX terminal) who has no concept of an outside world, or even of users other then themselves, and thus thinks a shell which mirrors their own spelling mistakes and convoluted acronyms is somehow user friendly.

Share this post


Link to post
Share on other sites