|
Post by Greenmile27 on Feb 15, 2004 13:38:26 GMT -5
Hi there,
i use SpeedCommander and there i can create an empty directory direct in my ZIP file. I try the same with VCLZip but i can't find a way to do that. How can i create valid Directory-Entries so that other ZIP-Viewers accept this direcories also? I want to create an empty directory, maybe someone can help.
Thx!
|
|
|
Post by Kevin on Feb 15, 2004 15:15:21 GMT -5
Set the AddDirEntriesOnRecurse property to true to add separate entries for each directory, including empty ones, while recursing subdirectories (recurse := true).
Also, you should be able to add an entry to FilesList like:
VCLZip.FilesList.Add('c:\somedir\mydir\');
to add just the dir entry. Notice it ends with the '\' which VCLZip recognizes as a dir entry. You should be able to add a dir like this even if it doesn't exist.
|
|
|
Post by Greenmile27 on Feb 15, 2004 15:28:31 GMT -5
Thanks a lot for your answer, but that doesn't work:
procedure TfrmMain.btnCreateDirClick(Sender: TObject); var Value:String; OldVal1,OldVal2:Boolean; begin If InputQuery('Directory?','Directory?'),Value) and (Value<>'') then begin OldVal2 := VCLZip1.Recurse; OldVal1 := VCLZip1.AddDirEntriesOnRecurse; Try VCLZip1.Recurse := true; VCLZip1.AddDirEntriesOnRecurse := true; VCLZip1.Fileslist.Clear; VCLZip1.Fileslist.Add('c:\somedir\'+Value+'\'); VCLZip1.Zip; Except End; VCLZip1.Recurse := OldVal2; VCLZip1.AddDirEntriesOnRecurse := OldVal1; End; end;
|
|
|
Post by Kevin on Feb 15, 2004 21:48:37 GMT -5
Actually that should store the entry, but it isn't storing the pathname that goes with it. Try also setting the Storepaths property to true.
|
|