StorageHelper DeleteOldFiles Method (DirectoryInfo, DateTime, Boolean)Kentico 8.0 API Reference
Deletes files older than specified time from the file system.

Namespace: CMS.IO
Assembly: CMS.IO (in CMS.IO.dll) Version: 8.0.0.0 (8.0.5239.26125)

Parameters

dir
Type: CMS.IO DirectoryInfo
Directory to process
olderThan
Type: OnlineSystem DateTime
Limit time for deletion of a file
deleteEmptyFolder (Optional)
Type: OnlineSystem Boolean
Indicates if the specified folder should be deleted if there are no files left at the end

Return Value

Type: OnlineBoolean
See Also