Back to Aurora Vision Studio website

You are here: Start » Filter Reference » System » File System » RemoveFile_ByTime

RemoveFile_ByTime


Module: FoundationLite

Removes files older than the specified date/time from a directory.

Name Type Description
Input value inDirectory Directory Directory from which the files will be deleted
Input value inDateTime DateTime Date/time
Input value inMask String Filter pattern
Input value inTimeVariant FileTimeVariant Variant of the time attribute to use
Input value inMaskType FileNameFilter Filter type to use with the mask
Input value inRecursive Bool Process subdirectories recursively
Input value inRemoveDirectories Bool Specifies whether to also delete directories that become empty after files are deleted from them
Output value outRemoved FileArray List of actually deleted entries

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
You can use any expression like examples below:
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 DateTime object with the unixTime field set to the desired value. MakeDateTime filter can be used to create such an object.

Complexity Level

This filter is available on Advanced Complexity Level.

Filter Group

This filter is member of RemoveFile filter group.

See Also

  • FindFiles – Returns files of the input directory.
  • MakeDateTime – Returns a valid DateTime object completed with the input parameters.