Rename(Name: String);
Name. New name.
The Rename method renames file or folder in archive.
Executing the example requires the archive: D:\Work\Archives\Data.zip. The Other folder and the WDI.xls file with data are added to the archive.
Add a link to the IO system assembly.
Sub UserProc;
Var
ZIP: IZipArchive;
ZIPEntry: IZipArchiveEntry;
Begin
ZIP := New ZipArchive.Create("D:\Work\Archives\Data.zip", ZipMode.Update);
ZIPEntry := ZIP.ItemByName("Other/");
ZIPEntry.Rename("Old");
ZIPEntry := ZIP.ItemByName("WDI.xls");
ZIPEntry.Rename("WDI_Old.xls");
Dispose ZIP;
End Sub UserProc;
After executing the example the specified folder and file are renamed in the Data.zip archive.
See also: