User (Old forums)MemberFebruary 18, 2004 at 10:38 amPost count: 23064
Here is directory information..
c:\test\good\empty\ —> empty folder..
first, here is sample code that I tested… and I use Delphi.
ZipEngine.FilesToProcess := ”;
ZipEngine.BasePath := ‘c:\test’;
ZipEngine.FilesToProcess := ‘test.txt’#13#10’good\*.*’;
ZipEngine.ExcludedFileAttributes := xfaVolume + xfaFolder;
ZipEngine.PreservePaths := True;
ZipEngine.ProcessSubfolders := True;
ZipEngine.ZipFilename := ‘c:\test\test.zip’;
This code compress ‘c:\test\test.txt’ and ‘c:\test\ohmy\test.txt’ both of them.. if there are same file name in subfolders, it compress together.. but I don’t want to…
Here is my desired result…
but Your ExceedZip 4.5 gives me this result..
Is there solution for it? Please let me know…
P.S : I tried to upgrade XceedZip 5.0, but it dosn’t work with ‘BasePath’ property, I tried it with my 4.5 registered key..
P.S : is 4.5 support BZip2? cuz, I tried to open *.bz2 file with it, but it gives me an error that need next disk…
Thanks a lot.
Imported from legacy forums. Posted by midmee (had 3174 views)User (Old forums)MemberFebruary 18, 2004 at 11:54 amPost count: 23064
First, you explicitly set ExcludedFileAttributes to “xfaVolume + xfaFolder”, which means “don’t add folder and volume entries to the zip file”. That’s why your empty folder does not get zipped. Set it to “xfaVolume” only. Folders and paths are two different things. PreservePaths makes sure every entry (file or folder) also remembers it’s full path (without BasePath). ExcludedFileAttributes rejects entries with those attributes.
Second, ProcessSubfolders applies to each and every entry in FilesToProcess, even those without wildcards. So the library matches all “test.txt” in any subfolders when ProcessSubfolders is true.
You have two choices:
A) Use an hidden feature exposed in “Xceed Backup Library”, but available in Xceed Zip ActiveX:
Each entry in FilesToProcess can end with either “<R>” or “<S>”, to indicate that this particular line should recurse. So, if you leave ProcessSubfolders to false, and append this suffix only to those lines you wish to be recursive, you will get the behavior you’re looking for. But I can’t garantee you this feature was exposed in every version of Xceed Zip ActiveX. You’d be better downloading the latest DLL. It supports v4.x licenses.
Your FilesToProcess would look like this:
<code> ZipEngine.FilesToProcess := ‘test.txt’#13#10’good\*.*<R>’;</code>
B) Use wildcards in the path portion of your FilesToProcess.
The Xceed Zip Compression Library lets you put wildcards in the path portion of a FilesToProcess entry. If you know the subfolder depth is limited, you can leave ProcessSubfolders to false, and add something like this in FilesToProcess:
<code> ZipEngine.FilesToProcess :=
This example will include every file in up to three subfolders deep.
By the way, the file pattern matching used by Xceed Zip is a strict matching. The use of <B>”*.*”</B> will only match files which <B>have an extention</B> (have a dot in their name). Use a simple “*” to match any file, with or without an extention.
Imported from legacy forums. Posted by Martin (had 3646 views)
- You must be logged in to reply to this topic.