DeleteEntry()
|
Previous Top Next |
:DeleteEntry(<cEntry> | <nEntry> | <oEntry>) --> nEntry
|
The single Parameter can be either a Character String, a Number, or a Central Directory Record Object:
|
|
<cEntry>
|
<cEntry> specifies the File Name of the Central Directory Record Entry that contains the information for the (File) Entry that should be deleted from the Zip File.
|
|
<nEntry>
|
<nEntry> specifies the Index Number of the Central Directory Record Entry that contains the information for the (File) Entry that should be deleted from the Zip File.
|
|
<oEntry>
|
<oEntry> specifies the ZipCentralDirectoryRecord object of the (File) Entry that should be deleted from the Zip File.
|
This method returns the (File) Entry's Index Number of the Central Directory Record that was deleted, or Zero (0), if the specified Entry could not be found.
|
This method deletes an existing (File) Entry from the Zip File, and also its corresponding Central Directory Record object and internal Status Array entry. If the deleted Entry was not the last in the Zip File, all following (File) Entries will be adjusted accordingly.
|
|
If a text string is specified as the Entry to be deleted, it will be interpreted as the File Name of the Central Directory Entry that should be selected, and the appropriate Central Directory Record object will be located in the Central Directory Array. If no matching Central Directory Record could be found, nothing will be deleted and the number 0 will be returned.
|
|
If instead a number is specified as the Entry, it will be interpreted as the Index Number of the Central Directory Record Entry that should be deleted. If that number does not correspond to a valid Central Directory Record Entry -- if it is 0 or its absolute value is greater than the number of Central Directory Record Entries -- nothing will be deleted and the number 0 will be returned.
|
|
If instead an object is specified as the Entry, it will be interpreted as the Central Directory Record object that should be deleted. If that object is not a valid Central Directory Record Entry, nothing will be deleted and the number 0 will be returned.
|
Open an existing Zip File named "MyArchive.zip" and delete a File Entry named "File2Delete.xxx" from it. Then save and close the updated Zip File:
|
|
oZip:New('MyArchive.zip')
|
oZip:DeleteEntry('File2Delete.xxx')
|
oZip:Close()
|