tushar Posted December 6, 2008 Report Share Posted December 6, 2008 In my application I need to store various files into a zip file. To locate required file easily I am also including one file called lookup.txt in my zip file which will have MD5 lookup. I have attached my code and it is not functioning as expected When I create new zip file it already contains a blank text file named lookup.txt, hence input to this VI is never an invalid zip file. When I add first pattern it gets added properly with name 1.ptn, when I add 2nd pattern it gets created properly with name 2.ptn but 1.ptn gets erased. And after that if I try to add more patterns no pattern gets added. Zip file always shows 2 file viz. lookup.txt and 2.ptn I am not getting any error. Must be some silly mistake but I am not getting it. Quote Link to comment
Rolf Kalbermatter Posted December 7, 2008 Report Share Posted December 7, 2008 QUOTE (tushar @ Dec 5 2008, 04:00 AM) In my application I need to store various files into a zip file. To locate required file easily I am also including one file called lookup.txt in my zip file which will have MD5 lookup.I have attached my code and it is not functioning as expected When I create new zip file it already contains a blank text file named lookup.txt, hence input to this VI is never an invalid zip file. When I add first pattern it gets added properly with name 1.ptn, when I add 2nd pattern it gets created properly with name 2.ptn but 1.ptn gets erased. And after that if I try to add more patterns no pattern gets added. Zip file always shows 2 file viz. lookup.txt and 2.ptn I am not getting any error. Must be some silly mistake but I am not getting it. You should really read the release notes to the ZLIB library. There is a section in it that reads: 2) Adding of files into existing ZIP archive supportedZLIB Compress Directory.viZLIB Compress Files.viZLIB Open ZIP Archive.viThe boolean parameter to append or truncate has been replaced by anenumeration to support addition of files into an existing archive.The old append value meant that the ZIP file was tacked to the endof the existing file which might have been useful for a selfextractingexecutable only.Following table shows the old and new settingsold value new value remarksFalse create new truncates existing file to 0True append to end appends to end of existing fileNA append to archive appends new files into the archive Obviously you do not want to use "append to end" but "append to archive" instead. Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.