[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: can't flush I know why, but no fix

T. Onoma

11/14/2003 3:15:00 AM

I figured out why it won't work. i'm using 1.8's open_uri to retrieve the url with open(url). as soon as this executes everything stops until it downloads the whole file! it isn't a real IO. blah! that stinks. not i wonder if net/http and net/ftp do the same since that's what oprn_uri is based on. if so then means i might have to get down to the socket level just to do a progess reported download. frig'n wonderful!

If anyone knows of a better way, or a code snippet i can steal, Please let me know.

Thanks,
-t0

2 Answers

Harry Ohlsen

11/14/2003 3:22:00 AM

0

Hi tO,

T. Onoma wrote:

> I figured out why it won't work. i'm using 1.8's open_uri to retrieve the url with open(url). as soon as this executes everything stops until it downloads the whole file! it isn't a real IO. blah! that stinks. not i wonder if net/http and net/ftp do the same since that's what oprn_uri is based on. if so then means i might have to get down to the socket level just to do a progess reported download. frig'n wonderful!
>
> If anyone knows of a better way, or a code snippet i can steal, Please let me know.

Sorry, I don't know of any code snippets you could use as a starting point.

However, it might be worthwhile modifying open_uri to allow the asynchronous download and progress notification you want, and then submit a patch, so this can end up in the core code.

Cheers,

Harry O.



Gavin Sinclair

11/14/2003 4:33:00 AM

0

On Friday, November 14, 2003, 2:15:18 PM, T. wrote:

> I figured out why it won't work. i'm using 1.8's open_uri to
> retrieve the url with open(url). as soon as this executes everything
> stops until it downloads the whole file! it isn't a real IO. blah!
> that stinks. not i wonder if net/http and net/ftp do the same since
> that's what oprn_uri is based on. if so then means i might have to
> get down to the socket level just to do a progess reported download.
> frig'n wonderful!

> If anyone knows of a better way, or a code snippet i can steal, Please let me know.


net/ftp allows you to download a file a bit at a time. Dunno about
net/http.

Gavin