Jump to content

Problem with openg ZLib


tushar

Recommended Posts

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.

Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.