J. with permission ...

One has to check a file at a time, here's an example that enumerates a folder (no recursion) and dumps all files older than (in this case) thirty days ... is this kinda what your looking for ?

code:

break on


$folder = "c:\winnt\system32"


$daysold = 30 ; check for files older than this many days


$today = @DATE
$rd_year = val(substr("$today",1,4))
$rd_month = val(substr("$today",6,2))
$rd_day = val(substr("$today",9,2))


gosub "intdate" ; get the internalized date


$check_date = $rd_internal - $daysold ; calculate the date to check against


$filename = dir("$folder")


while $filename <> "" and @error = 0


if (getfileattr($filename) & 16 ) = 0 ; not a dir ...


$time = getfiletime("$folder\$filename")
$rd_year = val(substr("$time",1,4))
$rd_month = val(substr("$time",6,2))
$rd_day = val(substr("$time",9,2))


gosub "intdate"


$file_date = $rd_internal


if $file_date < $check_date


?"$filename older than $daysold days..."


endif


endif


$filename = dir() ; one mo time


loop


exit 1


;=======
:intdate
;=======
;
; Library routine to convert a date from Calendar to internal format.
;
; The algorithm used here is taken directly from the following document:
;
;
; Variables passed:
; $rd_day IN Day of month (0-31)
; $rd_month IN Month of year (1-12)
; $rd_year IN Full year
; $rd_internal OUT Internal representation
;
; Amendment history:
; Version 1.0 21 June 2000 Richard Howarth
;
GLOBAL $rd_day,$rd_month,$rd_year,$rd_internal
DIM $MyYear,$MyMonth
$MyYear=$rd_year
$MyMonth=$rd_month
if $MyMonth < 3
$MyMonth = $MyMonth + 12
$MyYear = $MyYear - 1
endif
$rd_internal = $rd_day + ( 153 * $MyMonth - 457 ) / 5 + 365 * $MyYear +
$MyYear / 4 - $MyYear / 100 + $MyYear / 400 - 306
RETURN

;=======
:extdate
;=======
; Library routine to convert a date from internal to Calendar format.
;
; The algorithm used here is taken directly from the following document:
;
; Variables passed:
; $rd_day OUT Day of month (0-31)
; $rd_month OUT Month of year (1-12)
; $rd_year OUT Full year
; $rd_internal IN Internal representation
;
; Amendment history:
; Version 1.0 21 June 2000 Richard Howarth
;
GLOBAL $rd_day,$rd_month,$rd_year,$rd_internal
DIM $MyZ,$MyH,$MyA,$MyB,$MyC
$MyZ=$rd_internal + 306
$MyH=100*$MyZ-25
$MyA=$MyH/3652425
$MyB=$MyA-$MyA/4
$rd_year=(100*$MyB+$MyH)/36525
$MyC=$MyB+$MyZ-365*$rd_year-$rd_year/4
$rd_month=(5*$MyC+456)/153
$rd_day=$MyC-(153*$rd_month-457)/5
if $rd_month > 12
$rd_year=$rd_year + 1
$rd_month = $rd_month - 12
endif
RETURN


-Shawn

[ 27 September 2001: Message edited by: Shawn ]