Has someone devised a way to create a ZIP archive purely in memory? I know of rubyzip, but apparently it can only create an archive as a file. That''s not too bad, but if I can I''d prefer to do this in memory. Michael -- Michael Schuerig They tell you that the darkness mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org Is a blessing in disguise http://www.schuerig.de/michael/ --Janis Ian, From Me To You
Out of curiosity, why? If you want to work around it, you can mount a ramdisk and zip to a file in that... or perhaps look at FuseFS (http://rubyforge.org/projects/fusefs/) if you want to roll your own... Alternatively you could just use ZLib, but I assume you want zip for a reason... Cheers! -DF On 11/17/05, Michael Schuerig <michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote:> > Has someone devised a way to create a ZIP archive purely in memory? I > know of rubyzip, but apparently it can only create an archive as a > file. That''s not too bad, but if I can I''d prefer to do this in memory. > > Michael > > -- > Michael Schuerig They tell you that the darkness > mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org Is a blessing in disguise > http://www.schuerig.de/michael/ --Janis Ian, From Me To You > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Nov 16, 2005, at 4:25 PM, David Felstead wrote:> On 11/17/05, Michael Schuerig <michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote: >> Has someone devised a way to create a ZIP archive purely in memory? I >> know of rubyzip, but apparently it can only create an archive as a >> file. That''s not too bad, but if I can I''d prefer to do this in >> memory. > Out of curiosity, why?I guess he''s dynamically generating a zipfile for his users to download. e.g. download all posts from the past month. jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFDe88TAQHALep9HFYRAnAqAKCXdX2GHMP3zhHJIvaoAJRwESMRDQCghqHF jtogVZGjstVd2rQLiatrEOk=cafG -----END PGP SIGNATURE-----
On Thursday 17 November 2005 01:30, Jeremy Kemper wrote:> On Nov 16, 2005, at 4:25 PM, David Felstead wrote: > > On 11/17/05, Michael Schuerig <michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote: > >> Has someone devised a way to create a ZIP archive purely in > >> memory? I know of rubyzip, but apparently it can only create an > >> archive as a file. That''s not too bad, but if I can I''d prefer to > >> do this in memory. > > > > Out of curiosity, why? > > I guess he''s dynamically generating a zipfile for his users to > download.Exactly. Doing this in memory and then send_data''ing would just be more convenient than creating a temporary file and using send_file on it. Michael -- Michael Schuerig There is no matrix, mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org only reality. http://www.schuerig.de/michael/ --Lawrence Fishburn
Did anyone ever come up with a way of doing this (other than using chilkats zip library)? Thanks P -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
http://www.rubyonrailsblog.com/articles/2006/11/07/zipping-and-unzipping-multiple-directories-using-rubyzip what about that ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---