LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

copy data files to empty compressed(zipped) folder

Hi Everyone,
 
I was wondering if anyone knows how to programmatically move or copy a data file into an empty compressed(zipped) folder that has been made by the WindowsXP zipping utility.  I can manually drag and drop my files into the zip file to have them compressed by WindowsXP, but I need to accomplish that move or copy programmatically in Labview 7.1.  When I try to use the copy or move vi's in Labview, I get an error because my target path has a ".zip" extension.  I would appreciate any help that you can provide.
 
Thanks,
Bridge Guy
0 Kudos
Message 1 of 5
(3,878 Views)


@bridge guy wrote:
Hi Everyone,
 
I was wondering if anyone knows how to programmatically move or copy a data file into an empty compressed(zipped) folder that has been made by the WindowsXP zipping utility.  I can manually drag and drop my files into the zip file to have them compressed by WindowsXP, but I need to accomplish that move or copy programmatically in Labview 7.1.  When I try to use the copy or move vi's in Labview, I get an error because my target path has a ".zip" extension.  I would appreciate any help that you can provide.
 
Thanks,
Bridge Guy


LabVIEW uses the Win32 API file functions and they have no understanding of ZIP files at all. What you see in the XP Explorer is a so called shell extension that makes appear ZIP files as a directory. Only applications built on top of the shell32 COM like API can deal with this model, and one of the only applications doing that is the Windows File Explorer (or some of its third party replacements).

For the real Windows file functions a ZIP file is just a file like any other binary file and therefore you can't use standard file IO functions to access files in a ZIP archive. If you go to OpenG and download the OpenG Commander at http://prdownloads.sourceforge.net/ogpm/openg_commander-2.0-alpha3.zip you can then start this tool after having it installed and get a nice list of OpenG packages. One of them is the oglib_lvzip package, a nice library of VIs to deal with ZIP files.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 5
(3,859 Views)
Rolf,
 
Thank you very much for clearing that up.  I'll look into the OpenG source that you mentioned.
 
Bridge Guy
0 Kudos
Message 3 of 5
(3,846 Views)
On a sidenote: if you would upgrade to LabVIEW 8.0, you'll have all the tools you need right in the file I/O palette. 😄
 

Message Edited by altenbach on 12-30-2005 02:06 PM

0 Kudos
Message 4 of 5
(3,831 Views)


@altenbach wrote:
On a sidenote: if you would upgrade to LabVIEW 8.0, you'll have all the tools you need right in the file I/O palette. 😄
 

Message Edited by altenbach on 12-30-2005 02:06 PM


One caveat here! Those functions only support adding a file to a ZIP archive. You can't extract them or do any other things to a ZIP archive including password support.
And NI uses in fact the same zlib library and zip library  as is used in the OpenG lvzip tools but somehow didn't feel like exposing the extract part of that. Internally they use it anyhow as the new file size improvements they boost about in LabVIEW 8 are simply done by compressing substantial parts of the VI file resources with the ZLIB algorithme. While ZLIBs license is extremely liberal and basically allows you to do anything you like with it, except take the sources and claim that you wrote them, I would find it a nice treat if NI would at least acknowledge the great work of Jean-loup Gailly and Mark Adler for their ZLIB library as well as Gilles Vollant for the ZIP part in a prominent place.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 5 of 5
(3,814 Views)