Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Subroutines > MIAMEX

MX_DIRCLEAN

Scroll Prev Top Next More

Reviewed and revised April 2024

xcall MIAMEX, MX_DIRCLEAN, dirspec, loc'rem, status {,wildspec, flags, timelimit, bytes}

MX_DIRCLEAN (204) scans a specified directory, counting and/or deleting files based on various filter attributes.

This function has both a subroutine and a print tab implementation.

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  (Signed Int)  [out]

returns the number of files matched or deleted; negative values indicate errors

wildspec  (String)  [in]

optional wildcard spec (default is *.*)

flags  (Bitmap 8)  [in]

zero or more of the following bit flags:

Value

Meaning / Effect

&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  (T_FILETIME or B6)  [in]

time threshold (seconds since the 'epoch') if flags &h0001 or &h0002 are specified. Note that B4 will work up to 2038, but beyond that the value will overflow 32 bits.

bytes (Num)  [in/out]

on input, sets file size threshhold (if flags &h0004 or &h0008); on output returns number of bytes in the matching files

See Also

History

2023 August, A-Shell 6.5.1740:  Function added to A-Shell