At 11:40 AM 8/12/1998 -0500, Will Townsley wrote:
>Is there a way to list files by date and time?
>
>I am not interested in just listing files with
>date and time, but want to see them in sequence
>of date and time. I do not have any utilities,
>tools that are not included with a basic MPE/ix
>system and will not be getting any in the
>forseeable future.
>
>Thanks for any help.
>
Will:
I'm often in the position of determining what the oldest files on our 3000
are, or what the largest files are, by group and account. So I came up
with the following CI script. It isn't necessarily fast (actually, it's
kinda slow), doesn't do anything for Posix files (downright ignores them),
but it does the trick for me.
Any of you CI experts: feel free to pick it apart...
___________________________________________________________
Steve Patterson Halifax Port Corporation
[log in to unmask] Halifax, Nova Scotia
http://portofhalifax.ca CANADA
--------------
FLIST.PUB.SYS:
parm fset="@"
ECHO
ECHO File Lister
echo
echo This command file will list and sort files by either size
echo or by last modify date. The syntax of the command is:
echo
echo :FLIST (lists files in current GROUP.ACCOUNT)
ECHO :FLIST @.groupname
echo :FLIST @.groupname.accountname
echo
echo
setvar sortparm, "x"
while "!sortparm" <> "S" and "!sortparm" <> "M"
echo
setvar sortparm, "S"
input sortparm, "Sort by [S]ize or [M]odify date: S"
setvar sortparm, ups("!sortparm")
endwhile
setvar include, "x"
while "!include" <> "I" and "!include" <> "E"
echo
setvar include, "I"
input include, "[I]nclude or [E]xclude Image DB files: I"
setvar include, ups("!include")
endwhile
CONTINUE
PURGE SIZEFILE > $NULL
CONTINUE
PURGE SIZEFILE,TEMP > $NULL
FILE SIZEFILE;REC=-80,1,F,ASCII;DISC=10000
LISTF !fset,2 > *SIZEFILE
ECHO @@@ >> *SIZEFILE
setvar startmsecs, !hpcpumsecs
setvar startsecs, !hpconnsecs XEQ
FLIST2.PUB.SYS < *SIZEFILE setvar
totmsecs, !hpcpumsecs - !startmsecs setvar
totsecs, !hpconnsecs - !startsecs echo
echo
CPU Usage: !totmsecs milliseconds echo
Processing Time: !totsecs seconds echo
echo
input xx, "Press [Enter]
to view file list" echo
continue
purge filesort > $null
echo INPUT TSRTFIEL > SORTEMP
ECHO OUTPUT FILESORT >> SORTEMP
IF "!SORTPARM" = "S"
ECHO KEY 13,7,DESC >> SORTEMP
ELSE
ECHO KEY 22,8 >> SORTEMP
ENDIF
ECHO E >> SORTEMP
SORT.PUB.SYS < SORTEMP > $NULL
ECHO
CONTINUE
PURGE TSRTFIEL > $NULL
CONTINUE
PURGE TSRTFIEL, TEMP >$NULL
echo Filename Sectors Last Mod FCode
echo
print filesort;page=21
ECHO -----------------------------------------
ECHO Sectors: !totsec
---------------
FLIST2.PUB.SYS:
IF BOUND(REC)
DELETEVAR REC
ENDIF
IF BOUND(THREE)
DELETEVAR THREE
ENDIF
SETVAR REC, "XYZ"
SETVAR THREE, STR("!REC", 1, 3)
CONTINUE
PURGE TSRTFIEL > $NULL
CONTINUE
PURGE TSRTFIEL,TEMP > $NULL
SETVAR OUTREC, 0
SETVAR TOTSEC, 0
WHILE "!THREE" <> "@@@"
CONTINUE
INPUT REC
SETVAR THREE, STR("!REC", 1, 3)
IF "!THREE" <> "@@@"
SETVAR FNAME, LFT("!REC",8)
IF "!FNAME" = "ACCOUNT="
SETVAR ACCOUNT, RTRIM(STR("!REC",11,8))
SETVAR GROUP, RTRIM(STR("!REC",31,8))
ENDIF
SETVAR FSIZE, STR("!REC",56,7)
IF "!FNAME" <> " " AND "!FNAME" <> "ACCOUNT=" &
AND "!FSIZE" <> "----SPA" &
AND "!FSIZE" <> "SECTORS"
SETVAR FN, RTRIM("!FNAME")
SETVAR FILECODE, FINFO("!fn.!group.!account", 9)
SETVAR OUTPUT, "!FNAME !FSIZE " + &
"![finfo("!fn.!group.!account", -8)]" + &
" ![finfo("!fn.!group.!account", 9)]"
IF "!INCLUDE" = "I" OR &
("!INCLUDE" = "E" AND "!FILECODE" <> "PRIV")
ECHO !OUTPUT >> TSRTFIEL
SETVAR OUTREC, !OUTREC + 1
SETVAR TOTSEC, !TOTSEC + !FSIZE
ENDIF
ENDIF
ELSE
CONTINUE
SAVE TSRTFIEL
ENDIF
ENDWHILE
SETVAR GRPACCT, "!GROUP.!ACCOUNT,"
ECHO
IF "!INCLUDE" = "E"
SETVAR DBMSG, ", excluding Image DB files."
ELSE
SETVAR DBMSG, "."
ENDIF
ECHO In .!GRPACCT there are !outrec files!dbmsg
echo These files occupy !totsec sectors.
|