How to use FTP protocol in C?

I plan to learn sockets using the C language, and I want to create a basic FTP client. My question is: where should I start reading about FTP for socket programming in C?

And could you please provide some FTP library for C. Thank you.

+4
source share
6 answers

If you are trying to learn the material, just read the RFC and write the code. If you are developing software for serious purposes, use an existing, well-tested library. My recommendation is libcurl . If you do not want to use the library, just create a cURL instance from your C program and talk to him about it. Thus, you will also learn how to program channels in C along with sockets!

+7
source

You should probably use a library for this and not reinvent the wheel which library will be used on your platform. Is there a reason you need to use C rather than a higher level language, or just want the exercise to learn about socket programming with C?

Others recommended libCurl , it is also implemented in heaps of other languages. I would add ftplib and libftp (currently stopped) in this list. All of them are FOSS so good for studying.

+5
source

Defining a protocol here and for programming Beej Guide sockets is very nice.

+5
source

For FTP documentation, there are several relevant RFCs. They are dry but healthy.

For a more accessible discussion of the protocol, check out http://cr.yp.to/ftp.html

+3
source

Connecting to FTP really causes some headache for me. I don't know if the following link is useful. I happen to see it.

http://attractivechaos.wordpress.com/2009/08/02/read-files-on-ftphttp/

The program does not seem too long. I hope you find it helpful.

+2
source

All Articles