Posted by Chung Leong on 10/06/09 11:38
Eric Anderson wrote:
> d wrote:
> > As chung was hinting at, use the FTP wrapper by simply opening the file with
> > fopen() as you would a local file. You can then use fgets() to read a
> > single line at a time, process that line, and repeat until the file has been
> > read in its entirity.
>
> I thought about that but I am also reading a large number of file from
> the FTP server into the database and my assumption is that if I use
> fopen it will login to the FTP server everytime vs just once adding to
> the overhead a good bit.
>
> Thanks for the suggestion though. I'll keep it in mind.
>
> Eric
Good point. On the other, the file transfer would happen concurrently
with the database inserts. If the file is large, the time required
would be lower for the entire operation.
[Back to original message]
|