Subject: Ftp-WG: FTP client for Win32

From: Einar Bergsson <[email-masked]>
Date: Fri, 21 Sep 2001 05:12:46 -0500

Hello!

Has anyone seen a command line ftp client for Win32 (Windows NT/2000) which
has the source available? I have seen the dftp client on
www.ftp-protocols.org <http://www.ftp-protocols.org> , but that client is a
VERY thin. I need a more complete client.

Best Regards,

Einar Bergsson
Dir. of Research & Development 
Netverk Group of Companies
Tel: +354 585-2000
Mob: +354 897-0411 or +44 7866 733 213
Email: [email-masked]

This email and any documents attached to it are strictly confidential and
intended only for the person or persons to whom it is addressed. If you have
received this email in error please delete it without making any copies,
replying or forwarding it.

---

From: "Bryan Starbuck" <[email-masked]>
Date: Fri, 21 Sep 2001 10:30:21 -0500

If you are willing to use the Microsoft Wininet APIs, you can write an FTP
client in a day or two.

It's as simple as:
InternetOpen();
InternetConnect(szServer, szUsername, szPassword, ...);
FtpSetCurrentDirectory(szDirectory);
FtpGetFile(szSource, szDest, ...);
FtpDeleteFile(...);

Docs on:
http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/winin
et/wininet.asp

If you want to use custom or arbitrary FTP commands, use FtpCommand().  Such
as:

CHAR szResponse[SIZE_RESPONSE];
FtpCommand(hint, FALSE, FALSE, FTP_TRANSFER_TYPE_ASCII, "FEAT", NULL,
&hintResponse)))
InternetGetLastResponseInfo(TRUE, &dwError, szResponse, &cchSize);
InternetCloseHandleWrap(hintResponse, TRUE);

That just leaves the UI left to write.

-Bryan

================================
Bryan Starbuck
[email-masked]
Software Development Engineer

---

From: "Brad Clements" <[email-masked]>
Date: Fri, 21 Sep 2001 10:36:25 -0500

You might also want to look at Python, which includes a complete FTP client module.. 
You can write an FTP client in 32 seconds.

http://www.python.org

(also, just saw an announcement for the M2Cypto package today, which adds SSL/TLS 
support to the Python FTP client module)

---  sample FTP client code --

#!/usr/bin/env python
import ftplib

ftp = ftplib.FTP("ftp.murkworks.com")
ftp.login("notell","nopass")
try:
	ftp.delete("strader.tgz")
except:
	pass
ftp.storbinary("STOR strader.tgz",open('/tmp/strader.tgz'),4096)
ftp.quit()

Brad Clements,                [email-masked]   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com               AOL-IM: BKClements