New MIAMEX function MX_DIRCLEAN (204) scans a specified directory, counting and/or deleting files based on various filter attributes.
xcall MIAMEX, MX_DIRCLEAN, dirspec, loc'rem, status {,wildspec, flags, timelimit, bytes}
Parameters
dirspec (String) [in]
target directory, in any reasonable format; may include %env% variables
loc'rem (String) [in]
L)ocal interprets dirspec as local to application server; R)emote or C)lient interprets direspec as an ATE remote spec
status (Num) [out]
returns the number of files matched or deleted; negative values indicate errors
wildspec (String) [in]
optional wildcard spec (default is *.*)
flags (Num) [in]
sum of:
Value |
MeaningEffect |
&h0001 |
only files with mtime < timelimit |
&h0002 |
only files with timestamp < timelimit |
&h0004 |
only files > bytelimit |
&h0008 |
only files < bytelimit |
&h0010 |
no action (just count matching files, bytes; else delete) |
timelimit (filetime) [in]
time threshold (seconds since the 'epoch') if flags &h0001 or &h0002 specified
bytes (Num) [in/out]
on input, sets file size threshhold (if flags &h0004 or &h0008); on output returns number of matching files