Trailing-Edge - PDP-10 Archives - integ_tools_tops20_v7_30-apr-86_dumper - tools/com/
There are 6 other files named in the archive. Click here to see a list.
$!	TDIR.COM [optional file specification]
$!	Walter M. Lamia
$!	7-Jan-1983
$! DCL command file to produce a directory listing in reverse chronological
$! order by date of last modification.
$	sort=""		!override any local re-definition of SORT
$	read=""
$	on control_y then goto pool1
$	on error  then goto pool1
$!	write sys$output "...Taking directory..."	!Informational msg only
$! If you wish to change any of the qualifiers on the DIRECT command
$! do so here, and check that they do not alter the location of the 
$! date field which is used in the F$EXTRACT function in the first
$! read loop.  I suggest that you do NOT remove the /NOTRAIL qualifier.
$	direct/date=modif/size=all/prot/notrail/out=tmp.tmp/exclud=tmp.tmp  -
  'p1'  'p2'  'p3'  'p4'  'p5'  'p6'  'p7'
$	open/read p tmp.tmp
$	open/writ q tmp.tmp
$! The following statements copy the output of the DIRECT listing, and
$! prefix each line with the time and date in comparison format, as a
$! sort key.  Note that the first three lines are forced to be sorted 
$! at the beginning with the HIGH-VALUES key.  If an ascending sort is 
$! desired, change this to LOW-VALUES of all spaces.
$	tstr="zzzzzzzzzzzzzzzz"	!HIGH-VALUES, sort of
$	read p  pl		!copy the first blank line
$	write q tstr,pl
$	read p  pl		!read the header line
$	write q tstr,pl	!and write it with blank date string
$	read p  pl		!read & write a blank line
$	write q tstr,pl
$	read/end=pool p pl
$	tstr=f$extract(0,16,f$cvtime(f$extract(32,17,pl)))
$	write q tstr,pl
$	goto loop
$	close p
$	close q
$!	write sys$output "...Sorting..."	!Informational message
$	sort/key=(pos:1,siz:16,descend)/stable    tmp.tmp tmp.tmp
$	open/read p tmp.tmp
$	open/writ q tmp.tmp
$	read/end=pool1 p pl			!Strip off the date prefix
$	pl=f$extract(16,999,pl)
$	write q  pl
$	goto loop1
$	close/error=1 q
$	close/error=2 p
$	rd tmp.tmp
$	delete tmp.tmp;*
$	exit