Solved

unix ftp in c.

Posted on 1998-11-08
6
293 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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 AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
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…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

810 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