By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,413 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,413 IT Pros & Developers. It's quick & easy.

opening website

P: n/a
how to open a website like yahoo.com and use it as input? The
following code doesn't work.

#include"stdio.h"
int main()
{

FILE *f;
f=fopen("http://www.yahoo.com","r");
if(f==NULL)
puts("Error opening file");
return 0;
}

Jun 5 '07 #1
Share this Question
Share on Google+
15 Replies


P: n/a
Umesh <fr****************@gmail.comwrites:
how to open a website like yahoo.com and use it as input?
The standard C language and library don't provide a way. I
suggest that you look for an implementation-specific solution in
a newsgroup specific to your environment.
#include"stdio.h"
Should be #include <stdio.h>.
int main()
It's better to write function declarations in prototype form:
int main(void)
{

FILE *f;
f=fopen("http://www.yahoo.com","r");
if(f==NULL)
puts("Error opening file");
Normally this function call would have indentation beyond that of
the if statement..
return 0;
}
--
Comp-sci PhD expected before end of 2007
Seeking industrial or academic position *outside California* in 2008
Jun 5 '07 #2

P: n/a
On 6 5 , 12 29 , Umesh <fraternitydispo...@gmail.comwrote:
how to open a website like yahoo.com and use it as input? The
following code doesn't work.

#include"stdio.h"
int main()
{

FILE *f;
f=fopen("http://www.yahoo.com","r");
if(f==NULL)
puts("Error opening file");
return 0;

}- -

- -
i'm a Chinese student, my msm ID is :fl*******@163.com, could you
please add me as your fiend??

Jun 5 '07 #3

P: n/a
The c itself do not support opetations to network.It relay on platform
you used.

Jun 5 '07 #4

P: n/a
On 6 5 , 2 19 , Jinsere <bishi...@gmail.comwrote:
The c itself do not support opetations to network.It relay on platform
you used.
take a look at lib curl.

Jun 5 '07 #5

P: n/a
"Umesh" <fr****************@gmail.comschrieb im Newsbeitrag
news:11**********************@z28g2000prd.googlegr oups.com...
how to open a website like yahoo.com and use it as input? The
following code doesn't work.

#include"stdio.h"
#include <stdio.h>
int main()
{

FILE *f;
f=fopen("http://www.yahoo.com","r");
fopen is for opening a file stream, not a network connection.
Opening network connections is not topical here, try comp.unix.programmer.
if(f==NULL)
puts("Error opening file");
fputs(stderr, "Error opening file");

error messages should go to stderr, not stdout
return 0;
}
Bye, Jojo
Jun 5 '07 #6

P: n/a
"Joachim Schmitz" <no*********@schmitz-digital.dewrites:
"Umesh" <fr****************@gmail.comschrieb im Newsbeitrag
news:11**********************@z28g2000prd.googlegr oups.com...
[...]
> f=fopen("http://www.yahoo.com","r");
fopen is for opening a file stream, not a network connection.
Opening network connections is not topical here, try comp.unix.programmer.
The standard says very little about how file names are interpreted.
An implementation could easily support URLs as file names. (I know of
none that do so.)

--
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."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 5 '07 #7

P: n/a
On Jun 4, 9:29 pm, Umesh <fraternitydispo...@gmail.comwrote:
how to open a website like yahoo.com and use it as input? The
following code doesn't work.

#include"stdio.h"
int main()
{

FILE *f;
f=fopen("http://www.yahoo.com","r");
if(f==NULL)
puts("Error opening file");
return 0;

}

try using 'wput' . See man page for more info, or mail help to

hagen (at) itooktheredpill.dyndns.org

He might help you in this regards,

Bye

Guru Jois

Jun 5 '07 #8

P: n/a
"Keith Thompson" <ks***@mib.orgschrieb im Newsbeitrag
news:ln************@nuthaus.mib.org...
"Joachim Schmitz" <no*********@schmitz-digital.dewrites:
>"Umesh" <fr****************@gmail.comschrieb im Newsbeitrag
news:11**********************@z28g2000prd.googleg roups.com...
[...]
>> f=fopen("http://www.yahoo.com","r");
fopen is for opening a file stream, not a network connection.
Opening network connections is not topical here, try
comp.unix.programmer.

The standard says very little about how file names are interpreted.
True
An implementation could easily support URLs as file names. (I know of
none that do so.)
Umesh's implementation apparently doesn't either.

Bye, Jojo
Jun 5 '07 #9

P: n/a
Guru Jois said:

<snip>
try using 'wput' .
There is no wput function in C. Please learn C before trying to teach
it.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jun 5 '07 #10

P: n/a
Guru Jois wrote:
On Jun 4, 9:29 pm, Umesh <fraternitydispo...@gmail.comwrote:
>how to open a website like yahoo.com and use it as input? The
following code doesn't work.
.... snip ...
>
try using 'wput' . See man page for more info, or mail help to

hagen (at) itooktheredpill.dyndns.org

He might help you in this regards,
wput is non-standard. I don't object to the mention, I do object
to not so-identifying it.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jun 6 '07 #11

P: n/a
Keith Thompson wrote:
"Joachim Schmitz" <no*********@schmitz-digital.dewrites:
.... snip ...
>
>fopen is for opening a file stream, not a network connection.
Opening network connections is not topical here, try
comp.unix.programmer.

The standard says very little about how file names are interpreted.
An implementation could easily support URLs as file names. (I know
of none that do so.)
I seem to remember that Chris Torek has done extensions of this
flavor.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jun 6 '07 #12

P: n/a
Albert Lee wrote:
On 6 5 , 2 19 , Jinsere <bishi...@gmail.comwrote:
>The c itself do not support opetations to network.It relay on
platform you used.

take a look at lib curl.
That is not part of the C standard.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jun 6 '07 #13

P: n/a
CBFalconer <cb********@yahoo.comwrote:
wput is non-standard. I don't object to the mention, I do object
to not so-identifying it.
It also doesn't seem to be ubiquitous enough to merely refer a
potential user to the man page.

--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
Jun 6 '07 #14

P: n/a
May I automatically open a web page and save it as a text file to c:
\1.txt and then email it through outlook? Which language should I use?
Please guide me. Thank you in anticipation.

Jun 9 '07 #15

P: n/a
Umesh wrote:
May I automatically open a web page and save it as a text file to c:
\1.txt and then email it through outlook? Which language should I use?
Please guide me. Thank you in anticipation.
Something other than C. Goodbye.

--
Ian Collins.
Jun 9 '07 #16

This discussion thread is closed

Replies have been disabled for this discussion.