I'm planning to study sockets using C language, and I want to create a basic FTP client. My question is where should I start reading about FTP protocol for socket programming in C?
And could you please give some FTP library for C language. Thanks.
I'm planning to study sockets using C language, and I want to create a basic FTP client. My question is where should I start reading about FTP protocol for socket programming in C?
And could you please give some FTP library for C language. Thanks.
You should probably use a library for this rather than reinventing the wheel, what library to use depends on your platform. Is there any reason you need to use C rather than a higher level language, or do you just want an exercise to learn about socket programming with C?
Others have recommended libCurl, it has implementations in heaps of other languages as well. I would add ftplib and libftp (currently stopped) to that list. All are FOSS so great for study.
Protocol definition is here and for socket programming Beej's Guide is very nice.
PS: Try to improve your accept rate.
For documentation on FTP, there's a few relevant RFCs. They're dry but useful.
For a more accessible protocol discussion, check out http://cr.yp.to/ftp.html
If you are trying to learn stuff, just read the RFC and write code. If you are developing software for serious purposes, use an existing, well-tested library. My recommendation is libcurl. If you don't want to use a library, just spawn an instance of cURL from your C program and talk to it over pipes. That way you will also learn to program pipes in C, along with sockets!
Connecting to FTP really causes some headache for me. I do not 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. Hope helpful to you.