RemoveFile_ByTime
Removes files older than the specified timestamp from a directory.
Syntax
C++
Python
def RemoveFile_ByTime( inDirectory: str, inTimestamp: Timestamp, inMask: str, /, *, inTimeVariant: FileTimeVariant = FileTimeVariant.ModificationTime, inMaskType: FileNameFilter = FileNameFilter.Wildcard, inRecursive: bool = False, inRemoveDirectories: bool = True ) -> ( outRemoved: list[str], outRemovedSize: int )
Parameters
| Name | Type | Default | Description | |
|---|---|---|---|---|
![]() |
inDirectory | str | Directory from which the files will be deleted | |
![]() |
inTimestamp | Timestamp | Timestamp to compare files to | |
![]() |
inMask | str | Filter pattern | |
![]() |
inTimeVariant | FileTimeVariant | FileTimeVariant.ModificationTime | Variant of the time attribute to use |
![]() |
inMaskType | FileNameFilter | FileNameFilter.Wildcard | Filter type to use with the mask |
![]() |
inRecursive | bool | False | Process subdirectories recursively |
![]() |
inRemoveDirectories | bool | True | Specifies whether to also delete directories that become empty after files are deleted from them |
![]() |
outRemoved | list[str] | List of actually deleted entries | |
![]() |
outRemovedSize | int | Size of the deleted files in bytes |


