From: Axel Etzold Date: 2008-07-13T23:44:13+09:00 Subject: Re: [rubyzip + open-uri] reading zipfiles from a url? -------- Original-Nachricht -------- > Datum: Sun, 13 Jul 2008 22:50:21 +0900 > Von: David Masover > An: ruby-talk@ruby-lang.org > Betreff: Re: [rubyzip + open-uri] reading zipfiles from a url? > On Wednesday 02 July 2008 06:49:26 Janus Bor wrote: > > > url = "http://www.cibiv.at/%7Ephuong/vien/8a375.zip" > > zip_file = Zip::ZipFile.open(url) > > Maybe there is a right way to do this... > > I'm going to argue that it would be difficult at best. Zip files store > metadata, such as compressed file location, at the end of the file. After > that, you'd want to seek somewhere in the middle. Since open-uri is > probably > meant to issue a single, straightforward HTTP request (that is, ask for > the > whole file, from beginning to end), I'm not sure this would work well. > > But that's just an educated guess. > > Depending on how portable you need this to be, you might consider the > FUSE-based HTTPFS: > > http://httpfs.sourceforge.net/ > > When I last tried this, performance was pretty terrible -- no caching, and > it > would fetch the file in blocks, so _many_ separate HTTP requests. But it > would probably do what you want. Hi --- there is also rio (http://rio.rubyforge.org/): # Copy a file from a ftp server into a local file un-gzipping it rio('ftp://host/afile.gz').gzip > rio('afile') I have no idea what its performance would be. Best regards, Axel -- Psssst! Schon vom neuen GMX MultiMessenger geh�rt? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger