Results 1 to 2 of 2
if((update = fopen("http://www.???.com/update/version_update.txt", "r")) == NULL)
{
printf("Error Opening File.\n");
exit(1);
}
while( fgets(line_version, sizeof(line_version), update) != NULL )
{
printf("%s", line_version);
}
fclose(update);
// *** if i open local ...
- 01-08-2009 #1Just Joined!
- Join Date
- Jun 2007
- Posts
- 84
[c programing] how to use "fopen" open file on http: !!
if((update = fopen("http://www.???.com/update/version_update.txt", "r")) == NULL)
{
printf("Error Opening File.\n");
exit(1);
}
while( fgets(line_version, sizeof(line_version), update) != NULL )
{
printf("%s", line_version);
}
fclose(update);
// *** if i open local file is working.!!
- 01-10-2009 #2
fopen() only works on local files.
Doing network things is a whole different universe that the basic C library knows nothing about. If you want to open remote files, you either need to write it yourself (using sockets and low-level network calls) or find a library that somebody else has written that makes it simple to work with remote files over HTTP.DISTRO=Arch
Registered Linux User #388732


Reply With Quote