Highlighted
Absent Member.
Absent Member.
409 views

[archive] creating compressed folders or ZIP files

[Migrated content. Thread originally posted on 10 January 2006]

Historically we have used PKZIP for this function but it does have limited long name capabilities on 2000 and XP.

Does anyone have a better solution, or can the inbuild compressed folders function within Windows be accessed easily from ACU?

Keith
0 Likes
5 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] creating compressed folders or ZIP files

PkZip do have a version that handles long filenames.

In case you would rather not continue using PkZip. The 7Zip mentioned elsewhere is an option, just make sure to use the switch that makes it compatible with standard zip.

If you want to run it from COBOL without having to shell to OS, you could consider using zlib.dll (http://www.zlib.net/), a compression library for free use.

The compressed library facitily of Windows that allows you to open compressed libraries as folders is a feature of the Shell object. Frankly speaking, I don't know if you can you that to copy in and out via COM, but it sort of makes sense. When the day get 48 hrs I might look into that. 🙂
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] creating compressed folders or ZIP files

What version of PKZIP is that? I use 2.06. This has long name support only in Windows 9x and ME, not 2000 and XP.

I have a version of 7zip - I will look at it again as I cannot remember why I decided it wasn't suitable against PKZIP when I first looked at it.

Keith
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] creating compressed folders or ZIP files

Sorry, I might be wrong about PkZip then.

As for 7-zip, there is a switch you need to use to make Pkzip compatible archives, check it out and it should work.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] creating compressed folders or ZIP files

I use the command line pkzip, version 2.5 (pkzip25.exe), and it handles long filenames and I use it on Windows 2000 and XP.

But one minor annoyance is that they changed the command line parameters in 2.5, for example:

old:

pkzip output.zip file1 file2 file3

2.5:

pkzip25 -add output.zip file1 file2 file3
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] creating compressed folders or ZIP files

I will try version 2.5 to see if it behaves differently. Just so there is no misunderstanding, my problem is when the zip file itself has imbedded spaces and is a long file name i.e. i wish to zip or unzip a file called "my zip files.zip". Maybe my syntax is wrong

I use the following

pkzip -aex "my zip files" *.*

This creates a file named MY ZIP F.ZIP (not MY ZIP FILES.ZIP) so clearly to me, whilst wrapping the zip filename with quote marks does allow imbedded spaces, if still is restricted to short DOS name length.

If the file MY ZIP FILES.ZIP exists then the command

pkunzip -v "my zip file"
reports it cannot find the file - presumably for the same reasons.

Keith
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.