hkucsis
04-15-2003, 07:07 AM
Hi,
I am writing a cgi script that uses wget to get a page and then us open() to read the page content.
Here is my situation:
Suppose I wget a page and save it as a.html and then use open(). The problem is I can't read the content of a.html. I can read the file in another script. I guess this is due to when I try to read a.html, wget has not yet finished.....
How to solve this problem ?
Thanks.
here is my code: (for demontrative purpose only)
system("wget -O search_temp/abc http://www.google.com/") ;
open(fd, "search_temp/abc") ; // can't read anything
@file_content = <fd> ;
close (fd) ;
I am writing a cgi script that uses wget to get a page and then us open() to read the page content.
Here is my situation:
Suppose I wget a page and save it as a.html and then use open(). The problem is I can't read the content of a.html. I can read the file in another script. I guess this is due to when I try to read a.html, wget has not yet finished.....
How to solve this problem ?
Thanks.
here is my code: (for demontrative purpose only)
system("wget -O search_temp/abc http://www.google.com/") ;
open(fd, "search_temp/abc") ; // can't read anything
@file_content = <fd> ;
close (fd) ;