LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OpenG Zip a directory with file and folder structure Error 8

Solved!
Go to solution

I have used OpenG ZIP to zip a directory with only files and it works just fine. However, when I try to zip a directory with files and SubDirectories (and SubSubDirectories) I get an Error 8 result. I have the include subdirectories input set to TRUE and it still results in an Error 8.

 

Thanks,

 

Doug

Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 1 of 6
(713 Views)

Looks like setting the password to be some value is what is causing the error. Seeing how I need to use the password feature is this possibly a bug?

Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 2 of 6
(683 Views)

@DougFerguson wrote:

Looks like setting the password to be some value is what is causing the error. Seeing how I need to use the password feature is this possibly a bug?


I think it is more likely to be an "unimplemented feature" that the OpenG folks did not think to provide.  What kind of password feature do you want?  One that is compatible with WinZIP (if known)?  You could always (I suppose) create your own encrypting/decrypting ...

 

Bob Schor

0 Kudos
Message 3 of 6
(648 Views)

I remember running into problems too and I believe I had the same issue. In my case, I switched to using 7-Zip with the 7Z format, although I don't remember the exact reason for not using ZIP in 7Z. I believe it had some quirk with how it did the password protection.

 

You should be able to use the 7-Zip EXE and DLL next to your code without installing it. I used the following command with Format Into String and the System Exec VI:

"cmd /c 7za.exe a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -p"%s" "%s" "%s"".

 

These are the switches:


a Add (dir1 to archive.7z)
-t7z Use a 7z archive
-m0=lzma2 Use lzma2 method
-mx=9 Use the '9' level of compression = Ultra
-mfb=64 Use number of fast bytes for LZMA = 64
-md=32m Use a dictionary size = 32 megabytes
-ms=on Solid archive = on
-mhe=on 7z format only : enables or disables archive header encryption
-p{Password} Add a password

The three parameters at the end are the password, the full path of the created file and the path of the source folder.


___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(627 Views)
Solution
Accepted by topic author DougFerguson

@Bob_Schor wrote:

@DougFerguson wrote:

Looks like setting the password to be some value is what is causing the error. Seeing how I need to use the password feature is this possibly a bug?


I think it is more likely to be an "unimplemented feature" that the OpenG folks did not think to provide.  What kind of password feature do you want?  One that is compatible with WinZIP (if known)?  You could always (I suppose) create your own encrypting/decrypting


Well bug or unimplemented feature is of course debatable. It's definitely an omission that I hadn't yet noticed.

 

Included VI will fix that problem. It is in 2009 format and replaces the VI at <user.lib>\_OpenG.lib\lvzip\lvzip.llb\ZLIB Store File__ogtk.vi

 

 

Rolf Kalbermatter
My Blog
Message 5 of 6
(618 Views)

Well done and thank you for the quick resolution. Solution is exactly what I need for this project.

Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 6 of 6
(577 Views)