| Don,
Your suggestion brings up a point I had pondered over.
A user asked me how to do this very thing. She was asked to reduce her
disk usage and clean out some files. She could see at VMS what were
the largest files, but not how to associate that back to her ALL-IN-1
file cabinet and thus delete the appropriate document. I couldn't come
up with a reasonable answer at the time, but I'm sure someone has!
Terri K.
|
| As a matter of fact, Terri, there are a number of reports that people
have written that provide various information about the documents/files in a
user's File Cabinet. I have one, for example, that was geared specifically for
those wanting to do "cleanup" -- it can provide a listing of all of your docu-
ments in descending order of file size.
Here's the rough basis for it; maybe you can customize it for your
needs.
------------------------------
! GET_FILE_INFO.SCP
! Get some RMS file info from documents in the user's File Cabinet
! Open a file to store info about each document
TEXT_FILE OPEN OUT "FC_FILES.TXT"/WRITE
GET #CURFOLDER = ""
GET #PROCESS = "Processing folder !AS..."
! Make sure the subprocess is open
OA$SUB_OPEN
! For each document in the FC, get stuff like size, allocation, modified
! date, etc. Then, write a line to the output file containing that info.
FOR CAB$ DO -
.IF .FOLDER NES #CURFOLDER THEN -
GET #CURFOLDER = .FOLDER\\\\ -
OA$FAO #PROCESS,"OA$DISPLAY",#CURFOLDER\\\\ -
FORCE\\ -
GET $FILENAME = OA$CURDOC_FILENAME\\ -
COMMAND GET_FILE_INFO\\ -
CAL JUSTIFY #EOF\\ -
CAL JUSTIFY #ALQ\\ -
GET #LINE = -
.%KEY " " #EOF #ALQ " " .DAPOINTER " " #RDAT " " #USAGE\\ -
.IF (.DAPOINTER EQS "S") AND (#USAGE EQ 1) THEN -
GET #LINE = #LINE " *"\\ -
TEXT_FILE WRITE OUT #LINE
! Close the output file
TEXT_FILE CLOSE OUT
! Sort the output file by descending file size, and ascending folder within
! the same size
GET OA$DCL = -
"SORT/KEY=(POSITION:39,SIZE:4,DESCENDING)" -
"/KEY=(POSITION:1,SIZE:36,ASCENDING) " -
"FC_FILES.TXT FC_FILES.SIZ"
! Put a header on the report, and print it to the terminal
MERGE FC_FILES,FC_FILES.LIS
DELETE_FILE FC_FILES.TXT,FC_FILES.SIZ
LIST FC_FILES.LIS
-------------------------------
$! GET_FILE_INFO.COM
$! Using FILENAME as the basis, set up some ALL-IN-1 symbols with the file's
$! parameters
$!
$! First, check if the file pointed to is still there
$ FULLNAME = F$SEARCH(FILENAME)
$ IF FULLNAME .EQS. "" THEN GOTO NO_FILE
$!
$! Now, get some info about the file
$ ALQ = F$FILE(FILENAME,"ALQ")
$ EDAT = F$FILE(FILENAME,"EDT")
$ EOF = F$FILE(FILENAME,"EOF")
$ RDAT = F$EXTRACT(0,17,F$FILE(FILENAME,"RDT"))
$ Q == 1
$ IF F$EXTRACT(0,7,FILENAME) .EQS. "OA$SHAR" THEN -
@USR$:[NICODEM.OA]USAGE_COUNT
$ SET MESS/NOFAC/NOSEVER/NOID/NOTEXT
$ DELETE/SYMBOL/LOCAL Q
$ SET MESS/FAC/SEVER/ID/TEXT
$!
$! Write the info back to ALL-IN-1 symbols
$ CREATE_SYMBOLS:
$ WRITE OAMAILBOX -
"OA GET #ALQ = ""''ALQ'""\GET #EOF = ""''EOF'""\GET #USAGE = ""''Q'"""
$ @DCLMAILBOX:
$ WRITE OAMAILBOX "OA GET #EDAT = ""''EDAT'""\GET #RDAT = ""''RDAT'"""
$ @DCLMAILBOX:
$ EXIT
$!
$! File no longer exists; "fake" the return values
$ NO_FILE:
$ ALQ = "***"
$ EOF = "***"
$ EDAT = "No file available"
$ RDAT = "No file available"
$ Q == 0
$ GOTO CREATE_SYMBOLS
-------------------------------
FC_FILES.BLP
Folder Number Size All P/S Last modified Use
====== ====== ==== === === ================= ===
<&INCLUDE "FC_FILES.SIZ">
|
| I suppose that the report in .3 is of some value but it sounds like
what would be of more use is to allow a real live user to find a file
specification and to determine which document it is without having to
create a report. Reports are great if you're on an IBM system, of
course.
Below is a UDP which allows the user to give a part of the file
specification and obtain a list of any documents which contain that
segment.
Have fun,
don
! Find_Doc.UDP Find the document(s) for a given file spec
!
! Get the file name segment from the user
!
.prompt 24,1,"Filename: "
!
! Display any document containing the segment
!
.FX FORM AUTO SELECT FOR CAB$ WITH .FILENAME CONTAINING -
oa$script_text DO SEL_STYLE " " .FOLDER " " .DOCNUM " " .FILENAME -
/STYLE=DISPLAY
!
! [End]
|
| Take a look at this, it might answer your question. I only reproduced the
description.
Regards
Hilary
******************************
Conference: LARVAE::ASCOT_BULLETINS
Topic title: Index documents by size
Note title: Lines: 280
Author: HAND::BUGDEN
Number: 41.0 Created: 21-Jun-1991 11:02 Replies: 2
--------------------------------------------------------------------------------
+------------------------------+
| +--------------------------+ |
| | +----------------------+ | |
| | | ASCOT BULLETIN No.38 | | |
| | +----------------------+ | |
| +--------------------------+ |
+------------------------------+
ASCOT (ALL-IN-1 Support & Consultancy Team)
04 June 1991
Index documents by size
-=-=-=-=-=-=-=-=-=-=-=-
{Category : "Optional" (Customisation)}
________________________________________
Introduction
____________
This customisation allows the user to index documents by size. Two fields are
added to the EM index find form, these allow the user to specify a range in
blocks of documents to be included in the index. The size of a document can
be displayed using GOLD VIEW.
|