ftp connection through C.

R

rkpopuri

I want to connect to ftp server and automatically It should be running
as background process.
And Please tell me how to proceed. I have a webinterface which will
take the inputs "username" "password"
"Ipaddr" and "reomte file name containg its path". Now Want I need is
I should be able to access that file and get it.
 
F

Friedrich Dominicus

I want to connect to ftp server and automatically It should be running
as background process.
And Please tell me how to proceed. I have a webinterface which will
take the inputs "username" "password"
"Ipaddr" and "reomte file name containg its path". Now Want I need is
I should be able to access that file and get it.
check out decent library for that. I'd suggest having a look at
libcurl

Regards
Friedrich
 
W

Walter Roberson

I want to connect to ftp server and automatically It should be running
as background process.
And Please tell me how to proceed.

The C language predates TCP/IP by about a decade.
I have a webinterface which will

The C language predates web interfaces by about 25 years.
take the inputs "username" "password"
"Ipaddr" and "reomte file name containg its path". Now Want I need is
I should be able to access that file and get it.

You will have to use platform-specific methods to do any networking.
None of the C standards support any kind of networking (at all, in any
form.) You might be able to find a more-or-less portable third-party
non-standard library that handles all of the systems that you are
interested in having your code run on. Or you might not. Ask in
newsgroups that deal with development on the platforms you are
interested in.
 
A

Antoninus Twink

check out decent library for that. I'd suggest having a look at
libcurl

libcurl will certainly do what you want, but be aware that it's an
extremely powerful (and therefore extremely large and complex) library.

If you just want a basic ftp library (which is what it sounds like), and
aren't worried about clever stuff like multiple connections or being
able to use other protocols besides ftp, then ftplib will probably be
more suitable.

Alternatively, the ftp protocol isn't really that complicated - you
could have fun writing your own implementation just using the standard
networking functions for your system :)
 
W

Walter Roberson

libcurl will certainly do what you want, but be aware that it's an
extremely powerful (and therefore extremely large and complex) library.
If you just want a basic ftp library (which is what it sounds like), and
aren't worried about clever stuff like multiple connections or being
able to use other protocols besides ftp, then ftplib will probably be
more suitable.

Note though that the OP is going through a web interface with
username and password. That implies that one of the HTTP
authentication mechanisms is possibly in use; at the very least,
an HTTP FORM is in use. If, that is, the original poster was
accurate in saying "a webinterface" and it isn't just FTP -type
prompts.
 
A

Antoninus Twink

Note though that the OP is going through a web interface with
username and password. That implies that one of the HTTP
authentication mechanisms is possibly in use; at the very least,
an HTTP FORM is in use. If, that is, the original poster was
accurate in saying "a webinterface" and it isn't just FTP -type
prompts.

I'd assumed the OP was writing something like a cgi program, so that the
information supplied on the web form was somehow passed to the OP's
program as arguments or environment variables - of course if the OP is
implementing an HTTP transfer in his program as well, then libcurl would
be a good choice.
 
R

rkpopuri

I'd assumed the OP was writing something like a cgi program, so that the
information supplied on the web form was somehow passed to the OP's
program as arguments or environment variables - of course if the OP is
implementing an HTTP transfer in his program as well, then libcurl would
be a good choice.

Please tell me the specific APIs in this context since I have to
communicate basic functions like loading file from remote system.
 
J

jacob navia

Please tell me the specific APIs in this context since I have to
communicate basic functions like loading file from remote system.


I do not see why we should do your job for you.

It is *your* job to load a file from the remote system,
not ours. We can give you hints as to what to use,
but do not expect that we work for you for free. Sorry.

You download libcurl, you read the docs, you find the
API, you use it.
 
F

Friedrich Dominicus

Antoninus Twink said:
libcurl will certainly do what you want, but be aware that it's an
extremely powerful (and therefore extremely large and complex)
> library.
With all respect but the easy_curl interface is as the name suggest
easy.
Alternatively, the ftp protocol isn't really that complicated - you
could have fun writing your own implementation just using the standard
networking functions for your system :)
I can not see the fun in re-implementing something (with high
likliness much worse) than relying on time proved libraries. So I
disagree

Regards
Friedrich
 
R

Richard

With all respect but the easy_curl interface is as the name suggest
easy.
I can not see the fun in re-implementing something (with high
likliness much worse) than relying on time proved libraries. So I
disagree

Regards
Friedrich

Which part of "fun" confused you? Would you also outlaw all "write a
telephone database" courses in the first year at Uni? it#s called
learning by doing.
 
K

Kenny McCormack

I can not see the fun in re-implementing something (with high
likliness much worse) than relying on time proved libraries. So I
disagree

Regards
Friedrich

Which part of "fun" confused you? Would you also outlaw all "write a
telephone database" courses in the first year at Uni? it#s called
learning by doing.
[/QUOTE]

My esteemed colleague Mr. Twink is satirizing the regulars obsession
with "We cannot talk about it unless you provide source". Which
effectively makes anything that involves any 3rd party library OT.

Which effectively makes it impossible to discuss anything the least bit
non-trivial here.
 
J

jacob navia

Kenny said:
Gee - is Jacob applying for Clique membership (i.e., moving towards the
dark side) ?

I had always a dark side
:)

Look Kenny, why should we do the work for this guy?

Why is that "dark"?

We helped him with suggestions, we named the library (libcurl) that
solves his problems, and now he wants us to tell him exactly
the API, the calling sequence, etc etc!!!!

Why should we do that?
 
A

Antoninus Twink

I do not see why we should do your job for you.

It is *your* job to load a file from the remote system,
not ours. We can give you hints as to what to use,
but do not expect that we work for you for free. Sorry.

You download libcurl, you read the docs, you find the
API, you use it.

To be fair, libcurl is a pretty ferocious beast until you get used to
it, even with the "simpler" API. The OP can surely find some basic
tutorials using Google - and he can always ask again here if he has a
specific question about the API.
 
J

jacob navia

Antoninus said:
To be fair, libcurl is a pretty ferocious beast until you get used to
it, even with the "simpler" API. The OP can surely find some basic
tutorials using Google - and he can always ask again here if he has a
specific question about the API.

Well, yes, but what I feel is that at the end this
group is there to:

1) Do the homework of lazy students that find much easier to
post "questions that are not homework" here.

2) Do the work of programmers that get paid for doing nothing
during the time that we work for them, gathering docs,
learning how to use them etc.

There are quite a few examples for libcurl once you google around.
And, there are examples for the specific application the OP
is asking for.
 
A

Antoninus Twink

Well, yes, but what I feel is that at the end this
group is there to:

1) Do the homework of lazy students that find much easier to
post "questions that are not homework" here.

2) Do the work of programmers that get paid for doing nothing
during the time that we work for them, gathering docs,
learning how to use them etc.

There are quite a few examples for libcurl once you google around.
And, there are examples for the specific application the OP
is asking for.

I don't believe we are in disagreement here.
 
K

Kenny McCormack

I had always a dark side
:)

Look Kenny, why should we do the work for this guy?

Why is that "dark"?

I don't disagree with your intent. But I think many of us on the light
side will agree that the "tone" was not unlike that taken by many of
those on the dark side (aka, the "regulars").
 
J

jacob navia

Kenny said:
I don't disagree with your intent. But I think many of us on the light
side will agree that the "tone" was not unlike that taken by many of
those on the dark side (aka, the "regulars").

The tone was not insulting! I just told him that he should
do his job himself. That is not an insult as far as I can
see.

But maybe I am getting too sensible with my compiler system.
Since I distribute the compiler for free, I receive all types
of software requests. Since I work for free (people think)
I should work for them for free, debug their programs, write
sophisticated network analyzers, whatever!

Just say NO.
 
K

Kenny McCormack

[QUOTE="jacob navia said:
I don't disagree with your intent. But I think many of us on the light
side will agree that the "tone" was not unlike that taken by many of
those on the dark side (aka, the "regulars").

The tone was not insulting! I just told him that he should
do his job himself. That is not an insult as far as I can
see.[/QUOTE]

As I said, I don't disagree with your intent. I don't even disagree
with your choosing to be a little snotty about it.

I'm just sayin' that the style was that of the regulars (e.g., your
buddy Heathfield) and it just struck me as being a little strange
reading it with your name attached.

It all would have been right in character coming from one of them...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top