using libgsf as unzipper



This post refers back to a discussion of libgsf from 2009. At that time Morten Welinder was good enough to give me a revised version of libgsf's test-cp-zip.c that unzips a zip file; see

https://mail.gnome.org/archives/gnumeric-list/2009-May/msg00017.html

Morten's suggestion works nicely, except that to get the unzip ball rolling it's necessary to use gsf_outfile_stdio_new() to acquire a GsfOutfile into which the contents of the zip file will be written (via the recursive "clone" function, which relies on gsf_outfile_new_child_full). That is, in effect you have to create a new directory for the zip contents.

That's OK in some cases, but in other cases I just need to unzip the zipfile's contents "here", in the current directory. I tried passing "." in the initial call to gsf_outfile_stdio_new(), but -- unsurprisingly -- that failed with the message that the directory already exists.

Any suggestions on how to get around this would be gratefully received!

--
Allin Cottrell
Department of Economics
Wake Forest University, NC



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]