Back to Aurora Vision Library Lite website
You are here: Start » System » File System » RemoveFile_ByTime_Deprecated
RemoveFile_ByTime_Deprecated
| Header: | STD.h |
|---|---|
| Namespace: | avl |
Removes files older than the specified date/time from a directory.
Syntax
void avl::RemoveFile_ByTime_Deprecated ( const atl::Directory& inDirectory, const avl::DateTimeDeprecated& inDateTime, const atl::String& inMask, const avl::FileTimeVariant::Type& inTimeVariant, const avl::FileNameFilter::Type& inMaskType, bool inRecursive, bool inRemoveDirectories, atl::Array<atl::File>& outRemoved, atl::int64& outRemovedSize )
Parameters
| Name | Type | Default | Description | |
|---|---|---|---|---|
![]() |
inDirectory | const Directory& | Directory from which the files will be deleted | |
![]() |
inDateTime | const DateTimeDeprecated& | Date/time. UnixTime field is used for computation | |
![]() |
inMask | const String& | \"*\" | Filter pattern |
![]() |
inTimeVariant | const FileTimeVariant::Type& | ModificationTime | Variant of the time attribute to use |
![]() |
inMaskType | const FileNameFilter::Type& | 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 | Array<File>& | List of actually deleted entries | |
![]() |
outRemovedSize | int64& | Size of the deleted files in bytes |
Remarks
inMask pattern string
Port inMask specifies wildcard pattern that selects files this filter will operate on. Supported wildcards:- * - any string of characters, including no characters
- ? - exactly one character
Examples:
- * - all files,
- *.jpg - files only with extension .jpg,
- Filename.* - files with name "Filename" and any extension, including no extension e.g. "Filename."
- Filename.?? - files with name "Filename" and two letter extension,
Using regular expressions
When port inMaskType is set to Regex, the inMask port is interpreted as a regular expression pattern rather than a wildcard. The ECMAScript regular expression grammar is used. See some examples of regular expression patterns below:Regex patterns examples:
- .* - all files,
- .*\.jpg - files only with extension .jpg,
- Filename\..* - files with name "Filename" and any extension, including no extension e.g. "Filename."
- Filename\..{2} - files with name "Filename" and two letter extension,
Specifying the time
The inDateTime port must be set to a DateTimeDeprecated object with the unixTime field set to the desired value. MakeDateTime_Deprecated filter can be used to create such an object.Warning:All tools applied to a specific device or file should be managed within a single thread to ensure centralized tracking, traceability, and consistency throughout the process.
See Also
- FindFiles – Returns files of the input directory.
- MakeDateTime_Deprecated – Returns a valid DateTimeDeprecated object completed with the input parameters.


