Solved

unix ftp in c.

Posted on 1998-11-08
6
291 Views
Last Modified: 2010-04-15
I need to write in c or c++ a ftp for unix, that will get files from NT machine.
How I can write it in c or c++, I could not find a library that support the getFile or putFile ....
0
Comment
Question by:ofer1
  • 4
6 Comments
 
LVL 2

Expert Comment

by:bertvermeerbergen
ID: 1254099
I suppose you only want to write an ftp client, and that you have an ftp server running on the NT.  Writing a client is not very hard, but as you certainly know, there is one in every standard unix distribution.  So make sure you have a good reason to start reinventing the wheel.
This said, you have a few options:
1. Get RFC959 and implement the client functionality.  If you know about socket programming, it really is not that hard.
2. Since you have a Unix box, use the standard ftp server deamon to do all the hard work and just write your client to handle the control connection, initiating transfer between the NT and Unix ftp server (so called proxy transfers).  See Q.10052364 for more info on how this works.
3. Get the source code for the ftp client under Linux.  This will give you a very good starting point (Just don't copy it and put your name under it).
4. Wait for someone to supply you with a reference to a library that implements getFile/putFile.  I suppose there must be one somewhere, but I do not have any info on this.  But if you are looking for additional control over the ftp session (the only good reason to write your own client, in my opinion), I do not think you really want do you such a library.
0
 
LVL 2

Expert Comment

by:bertvermeerbergen
ID: 1254100
Check out Q.10095891.  Client FTP functionality is currently being discussed under that topic.
0
 
LVL 10

Accepted Solution

by:
rbr earned 20 total points
ID: 1254101
Every Unix will have a ftp client. You can call it by system out of C.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 2

Expert Comment

by:bertvermeerbergen
ID: 1254102
You can, but how do you pass the commands you want executed ?
And just try to capture errors or even making sure that the files are down- or uploaded.  Every 'normal' ftp client I have seen is well designed to be used interactively.  Programmatic control was never an option during the design, I suppose.

0
 

Author Comment

by:ofer1
ID: 1254103
rbr believe me or not, if i had new how to call this ftp client from c, I wasn't put this question here
0
 
LVL 2

Expert Comment

by:bertvermeerbergen
ID: 1254104
ofer1, did you get some work done on your ftp client implementation ?

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now