473,396 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Is there any library to get/fetch a remote URL?

Hi.

I would like to fetch a remote URL by using C and get its
contents:
myfile = get("http://www.foo.com/foo.html")

Does exist any C library?

Thank you very much.
Nov 14 '05 #1
13 2510
Francesco Moi <fr**********@europe.com> scribbled the following:
Hi. I would like to fetch a remote URL by using C and get its
contents:
myfile = get("http://www.foo.com/foo.html") Does exist any C library?


What's wrong with the answer already given by Jacob Navia?

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"There's no business like slow business."
- Tailgunner
Nov 14 '05 #2
Francesco Moi <fr**********@europe.com> spoke thus:
I would like to fetch a remote URL by using C and get its
contents:
myfile = get("http://www.foo.com/foo.html")
Does exist any C library?


Not in standard C. If you're using *nix and wget is installed, you
might be able to do something like

system( "wget http://www.foo.com/foo.html" );

and then open the file with fopen() and proceed from there.

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #3
Joona I Palaste wrote:
Francesco Moi <fr**********@europe.com> scribbled the following:
Hi.


I would like to fetch a remote URL by using C and get its
contents:
myfile = get("http://www.foo.com/foo.html")


Does exist any C library?

What's wrong with the answer already given by Jacob Navia?


Yes, I would like to know too... :-)
Nov 14 '05 #4
fr**********@europe.com (Francesco Moi) writes:
I would like to fetch a remote URL by using C and get its
contents:
myfile = get("http://www.foo.com/foo.html")

Does exist any C library?


There is no portable way to do this. For non-portable solutions,
consult your system documentation or, if that fails, ask in a
newsgroup specific to your system.

<OT>
On Unix-like systems, you might consider invoking the "wget" program
with appropriate arguments. Note that "wget" may or may not be
installed on a given system.
</OT>

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #5
Christopher Benson-Manica <at***@nospam.cyberspace.org> writes:
Francesco Moi <fr**********@europe.com> spoke thus:
I would like to fetch a remote URL by using C and get its
contents:
myfile = get("http://www.foo.com/foo.html")
Does exist any C library?


Not in standard C. If you're using *nix and wget is installed, you
might be able to do something like

system( "wget http://www.foo.com/foo.html" );

and then open the file with fopen() and proceed from there.


Frankly, this is a good example of why it's best not to go into too
much detail when giving hints about system-specific solutions. Anyone
using this solution would have to be aware of the fact that wget by
default writes its file to the current directory, which might be
unwritable or nonexistent, or which might already have a file of the
same name. Such concerns are off-topic here, but perfectly
appropriate in one of the Unix groups such as comp.unix.programmer.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #6
Keith Thompson <ks***@mib.org> spoke thus:
Frankly, this is a good example of why it's best not to go into too
much detail when giving hints about system-specific solutions.


<ot>Well, obviously I didn't go into those details, did I? I
appreciate your concerns, but I don't think any great damage was done
by casually suggesting a possible solution along with the OT message
and links to the relevant clc documents.</ot>

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #7
Joona I Palaste <pa*****@cc.helsinki.fi> wrote in message news:<cj**********@oravannahka.helsinki.fi>...
Francesco Moi <fr**********@europe.com> scribbled the following:
Hi.

I would like to fetch a remote URL by using C and get its
contents:
myfile = get("http://www.foo.com/foo.html")

Does exist any C library?


What's wrong with the answer already given by Jacob Navia?


The answer is not related with "Standard C".

I thank the help, but I'm looking for another solution...
Nov 14 '05 #8
Francesco Moi wrote:
Joona I Palaste <pa*****@cc.helsinki.fi> wrote in message news:<cj**********@oravannahka.helsinki.fi>...
Francesco Moi <fr**********@europe.com> scribbled the following:
Hi.

I would like to fetch a remote URL by using C and get its
contents:
myfile = get("http://www.foo.com/foo.html")

Does exist any C library?


What's wrong with the answer already given by Jacob Navia?

The answer is not related with "Standard C".


<rant>
THEN THE QUESTION DOESN'T BELONG HERE!
</rant> I thank the help, but I'm looking for another solution...


Indeed.

--ag

--
Artie Gold -- Austin, Texas

"If you don't think it matters, you're not paying attention."
Nov 14 '05 #9
fr**********@europe.com (Francesco Moi) wrote:
Joona I Palaste <pa*****@cc.helsinki.fi> wrote in message news:<cj**********@oravannahka.helsinki.fi>...
Francesco Moi <fr**********@europe.com> scribbled the following:
Hi.

I would like to fetch a remote URL by using C and get its
contents:
myfile = get("http://www.foo.com/foo.html")

Does exist any C library?


What's wrong with the answer already given by Jacob Navia?


The answer is not related with "Standard C".

I thank the help, but I'm looking for another solution...


There is no ISO C answer. Jacob's answer is likely not of use to you
either, unless you're willing to lock yourself into his libraries, and
the way he's been talking about them here make me think that that would
be inadvisable. However, if you're able to use POSIX extensions (which,
if you've got a system capable of using HTTP like that, is quite
likely), comp.unix.programmer might be able to provide you with an
answer.

Richard
Nov 14 '05 #10
In article <ln************@nuthaus.mib.org>, Keith Thompson wrote:
fr**********@europe.com (Francesco Moi) writes:
I would like to fetch a remote URL by using C and get its
contents:
myfile = get("http://www.foo.com/foo.html")

Does exist any C library?


There is no portable way to do this. For non-portable solutions,
consult your system documentation or, if that fails, ask in a
newsgroup specific to your system.

<OT>
On Unix-like systems, you might consider invoking the "wget" program
with appropriate arguments. Note that "wget" may or may not be
installed on a given system.
</OT>


You might want to try libcURL. In my experience, it's quite a nice
library, which is available for lots of platforms.

The url for curl (command-line program) and libcurl (the library)
is http://curl.haxx.se/

Cheers,
Ilja
--
Ilja Booij
IC&S B.V.
Nov 14 '05 #11
Artie Gold <ar*******@austin.rr.com> wrote in message news:<2s*************@uni-berlin.de>...
Francesco Moi wrote:
Joona I Palaste <pa*****@cc.helsinki.fi> wrote in message news:<cj**********@oravannahka.helsinki.fi>...
Francesco Moi <fr**********@europe.com> scribbled the following:

Hi.

I would like to fetch a remote URL by using C and get its
contents:
myfile = get("http://www.foo.com/foo.html")

Does exist any C library?

What's wrong with the answer already given by Jacob Navia?

The answer is not related with "Standard C".


<rant>
THEN THE QUESTION DOESN'T BELONG HERE!
</rant>
I thank the help, but I'm looking for another solution...


Indeed.

--ag


The answer I'm trying to find IS RELATED with "Standard C"
The answer given by Jacob Navia IS NOT RELATED with "Standard C".
Nov 14 '05 #12
Francesco Moi <fr**********@europe.com> scribbled the following:
Artie Gold <ar*******@austin.rr.com> wrote in message news:<2s*************@uni-berlin.de>...
Francesco Moi wrote:
> Joona I Palaste <pa*****@cc.helsinki.fi> wrote in message news:<cj**********@oravannahka.helsinki.fi>...
>>Francesco Moi <fr**********@europe.com> scribbled the following:
>>>Hi.
>>
>>>I would like to fetch a remote URL by using C and get its
>>>contents:
>>>myfile = get("http://www.foo.com/foo.html")
>>
>>>Does exist any C library?
>>
>>What's wrong with the answer already given by Jacob Navia?
>
>
> The answer is not related with "Standard C".
<rant>
THEN THE QUESTION DOESN'T BELONG HERE!
</rant>
> I thank the help, but I'm looking for another solution...


Indeed.

The answer I'm trying to find IS RELATED with "Standard C"
The answer given by Jacob Navia IS NOT RELATED with "Standard C".


The fact is, it is *IMPOSSIBLE* within the limits of Standard C to fetch
the contents of an URL, or to do anything else with the Internet or
other networking at all, for that matter. So Non-Standard C answers are
the best you're going to get.
Therefore I suggest you either start asking for platform-specific help
on platform-specific newsgroups (not on comp.lang.c) or forget about
the entire thing.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Last year he disrespected me - and then he showed lack of respect."
- Anthony Mason
Nov 14 '05 #13
On 6 Oct 2004 04:50:14 -0700, in comp.lang.c , fr**********@europe.com
(Francesco Moi) wrote:
Artie Gold <ar*******@austin.rr.com> wrote in message news:<2s*************@uni-berlin.de>...
>
> The answer is not related with "Standard C".
>

The answer I'm trying to find IS RELATED with "Standard C"


Yes, and you've already had an answer: "This can't be done in Standard C".
You need to carefully read all replies, even the ones you don't like.
The answer given by Jacob Navia IS NOT RELATED with "Standard C".


Indeed.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dharmesh Gandhi | last post by:
DB-Library Error 10007: General SQL Server error: Check messages from the SQL Server. CREATE PROCEDURE . ( @srvr varchar(50),
6
by: Randell D. | last post by:
Folks, I know javascript has no local or server based access to the disk however I was wondering if one can read a remote page and take its html <TITLE> value... My guess is no but thought...
7
by: Bernard Lebel | last post by:
Hello, I'm stumbled at a serious problem, and quite frankly getting desparate. This is a rather long-winded one so I'll try to get straight to the point. I have this Python program, that...
5
by: funkyj | last post by:
I love pexpect because it means I may never have to use expect again (I don't do any heavy expect lifting -- I just need simple tty control)! As a python advocate I find it embarassing how...
7
by: galico | last post by:
Hi All, We are having a very strange problem with the above. We have designed an application in ASP.NET 2.0 that uses the enterprise library data application blocks amongst others. We seem to be...
24
by: Earl | last post by:
I have all of my data operations in a separate library, so I'm looking for what might be termed "best practices" on a return type from those classes. For example, let's say I send an update from...
3
by: SimonPlatten | last post by:
Hi, I'm a software engineer working in the offshore industry, I've been coding in various languages professionally since 1987. In my present employment I am working with control systems in the...
7
by: Peter Bradley | last post by:
OK. A bit behind the times, I know; but we're just moving over to .NET 2.0. How on earth do you manage configuration settings in a class library in .NET 2.0? In version 1.1, we used a handy class...
7
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I am trying to see if I can call a Library remotely. The library contains a Form that I want to display then pass back some data to user that called this form remotely. I have it working...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.