Method: AddExisting for AutoRemove
- Updated2024-09-12
- 1 minute(s) read
DataPlugin > Methods > Method: AddExisting for AutoRemove
Method: AddExisting for AutoRemove
Reserves a file or a folder for deletion. The folder is deleted automatically, as soon as the DataPlugin has stopped importing the data.
Object.AddExisting(sFileOrFolder)
| Object | AutoRemove Object with this method |
| sFileOrFolder | String Specifies the file or the folder to be deleted. |
The following example creates a temporary folder, unzips the ZIP archive FileName in this folder, and imports the data of the first file with the ATFX DataPlugin. As soon as the DataPlugin no longer needs the unzipped data, the example deletes the temporary folder and also the C:\Temp\ folder.
Sub ReadStore(FileName) Dim TempFolder TempFolder = AutoRemove.CreateFolder() Dim FileList FileList = Unzip(FileName, TempFolder) Call Root.ImportStore(TempFolder & FileList(0), "ATFX") 'further instructions Call AutoRemove.AddExisting("C:\Temp\")End Sub