tags:

views:

189

answers:

6

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.

+5  A: 

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.

Dale Halliwell
He states he wants to study, not to write an application.
Cem Kalyoncu
yup i just want to study the FTP protocol but i think its nice if you have any suggestions for a FTP library for C. Thanks
sasayins
look into curl if you wanna easy implementation ...
RageZ
writing a hello world type app is probably the best way to study, especially for a language like C
Dale Halliwell
+5  A: 

Protocol definition is here and for socket programming Beej's Guide is very nice.

PS: Try to improve your accept rate.

Cem Kalyoncu
I like the PS part :)
Aviator
thanks. I will improve my accept rate in the coming days.
sasayins
I like the answer better ...
RageZ
+5  A: 

My personal favorites

Wikipedia for FTP

Beej's Guide to Network programming

Aviator
+3  A: 

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

James Healy
+6  A: 

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!

Vijay Mathew
i will look the libcurl and your suggestions. thanks a lot.
sasayins
+2  A: 

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.