-   Programming (
-   -   FTP program in C (

shibdas 02-09-2004 04:45 AM

FTP program in C
Hi everybody,
I am to develop a C program on unix system to transfer files between two unix machines using FTP. Now, it should provide all the FTP facilities and it should resend the file which is not properly transmitted. Giving this situation what should i do, should i go for an implementation of FTP in my program or should i use any third party library, please provide me your advice and send me links of some third party FTP development library which works under unix and it should be portable.

Thanks in advance


jim mcnamara 02-09-2004 09:19 AM

Why must it be in C?

We have a very robust FTP system that is implementated totally in shell script. We FTP between all sorts of machines in-house, and to vendor sites outside.

The overall design is simple:
A control file that lists the source filename(or directory), and a script that takes requests to move files. The script that moves files gets all of it's information about the file(s) from the control file.

shibdas 02-09-2004 12:55 PM

Requirement of the project is C so I may not be able to do it in shell script but i think i can call the script from the c program, isn't it. Can you provide me some code of the script just give a more detailed idea, thanks for the reply

wapcaplet 02-09-2004 03:37 PM

If you're asking us to do your homework, I'm afraid we can't oblige :)

Have you tried using Google to search for ideas? I presume that if you are being given this assignment, your teacher or professor has given you some resources with which to get it accomplished.

jim mcnamara 02-09-2004 04:15 PM

I had thought the same :D A programmer would usually snap at anything reasonable to get the job done. Students are stuck with stupid requirements.

shibdas 02-09-2004 10:28 PM

I just wanted some idea and pseudocode. I know that I have to do the job and will try to do it best to my ability, I just wanted to discuss some ideas with you all, as there is no one to help me out here as. The person who has assigned me the job does not know anything about it.

Anyways thanks for the help


worldmagic 02-10-2004 09:43 AM

Comeon everyone. What student gets stuct implementing an FTP in C?

If using Shell, I beleave most would use 'scp' anyday over a scripted FTP. (If both machines are yours).

I sadly cant provide you with a C-library for this, but.. a guess would be to google for ncftp/wget source, maybe someone of them has implemented one. All depends on the licenses tho.

worldmagic 02-10-2004 09:45 AM

wapcaplet 02-10-2004 02:37 PM


Originally posted by worldmagic
Comeon everyone. What student gets stuct implementing an FTP in C?
Well, I had to write an email application (sorta like a simple sendmail), and a basic web server in C for one of my courses in undergrad. It's not all that complicated. With a few resources and some sample code to look at, it didn't take too long to figure out.

shibdas 02-10-2004 10:30 PM

Thanks worldmagic for your link, i even don't have the permission to set up a library in the system so i am working with basic ftp client provided with the HP-UX system. I will use the library if i get a chance.

A request to u all, don't start a debate regarding on should help others or one has to do his own job. I have already progressed some of my work and i have done file transfer application previously. I just wanted to discuss the whole matter to all of u, afterall this healthy environment of discussion will help us to progress our work and deploy new ideas.

Linux is a perfect example of this philosophy, so don't start a debate and continue our discussion as we have always done

Thanks everybody


All times are GMT -5. The time now is 08:34 PM.