The following routines remain for backward compatibility only. New code should use the suggested replacement, which is normally both more powerful and more efficient.
CALL FMFNMS (PATH,FILES*,KEYS*,NKEYS*,MAXKEY,IRC*)
This routine returns the file names and keys vectors in the directory specified by PATH. NKEYS returns the actual number of files and keys returned. If more than MAXKEY files are found, IRC will be non-zero. Otherwise IRC will be 0.
N.B. This routine returns ALL file names in the specified directory in the order in which they were added to the catalogue. See the routine on Page for details of how to sort the FILES arrary.
The suggested replacement for this routine is FMLFIL, which provides wild-card support.
Example of using the FMFNMS routine
PARAMETER (LKEYFA=10) PARAMETER (MAXKEY=100) CHARACTER*20 FILES(MAXKEY) INTEGER KEYS(LKEYFA,MAXKEY) CALL FMFNMS('//CERN/DELPHI'// + '/ALLD/RAWD/CERN/V001/E091.00/P01R000314/NONE', + FILES,KEYS,NKEYS,MAXKEY,IRC) IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMFNMS'
Using the FMLFIL routine as a replacement for FMFNMS
PARAMETER (LKEYFA=10) PARAMETER (MAXKEY=100) CHARACTER*255 FILES(MAXKEY) INTEGER KEYS(LKEYFA,MAXKEY) ICONT = 0 * On return, IRC = -1 if more than MAXKEY files found. * Call FMLFIL again with ICONT ^=0 to retrieve the next batch of MAXKEY files. CALL FMLFIL('//CERN/DELPHI'// + '/ALLD/RAWD/CERN/V001/E091.00/P01R000314/NONE/*', + FILES,KEYS,NKEYS,MAXKEY,ICONT,IRC) IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMLFIL'
CALL FMLIST (PATH,FILES*,KEYS*,NFOUND,MAXFIL,IRC*)
MAXFIL
to return the names of the files found.
(10,MAXFIL)
to return the keys
vectors associated with the file names in FILES
.
FILES
and
then actual second dimension of KEYS
.
KEYS
.
The suggested replacement for this routine is FMLFIL, which allows an arbitrary number of file names to be returned.
This routine returns the file names and keys vectors in the directory tree specified by PATH. The directory tree may contain wild-cards (* or %) in any position, or numeric ranges specified as (mm:nn), such as (13:147). See on Page for more details. NFOUND returns the actual number of files and keys returned. If more than MAXFIL files are found, IRC will be non-zero. Otherwise IRC will be 0. N.B. This routine returns ALL file names in in the order in which they were added to the catalogue. See the routine on Page for details of how to sort the FILES array.
Example of using the FMLIST routine
PARAMETER (LKEYFA=10) PARAMETER (MAXFIL=1000) CHARACTER*255 FILES(MAXFIL) INTEGER KEYS(LKEYFA,MAXFIL) CALL FMLIST('//CERN/DELPHI'// + '/ALLD/RAWD/*/E091.*/P01R000%%%/NONE', + FILES,KEYS,NFOUND,MAXFIL,IRC) IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMLIST'
Using the FMLFIL routine as a replacement for FMLIST
PARAMETER (LKEYFA=10) PARAMETER (MAXKEY=100) CHARACTER*255 FILES(MAXKEY) INTEGER KEYS(LKEYFA,MAXKEY) ICONT = 0 * * On return, IRC = -1 if more than MAXKEY files found. * Call FMLFIL again with ICONT ^=0 to retrieve the next * batch of MAXKEY files. * CALL FMLFIL('//CERN/DELPHI'// + '/ALLD/RAWD/CERN/V001/E091.00/P01R000314/NONE/*', + FILES,KEYS,NKEYS,MAXKEY,ICONT,IRC) IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMLFIL'
CALL FMTREE (PATH,SUBDIR*,NLEVEL,NFOUND*,MAXDIR,IRC*)
The suggested replacement for this routine is FMLDIR, which provides wild-card support and allows an arbitrary number of file names to be returned.
This routine returns in the character array SUBDIR the names of all directories below and including the input directory specified in PATH down to the level NLEVEL. MAXDIR specifies the maximum dimension of the array SUBDIR. NFOUND returns the number of directories found. Should NFOUND be less than or equal to MAXDIR, SUBDIR(NFOUND) will be the name of the current directory. If NFOUND > MAXDIR, IRC will be non-zero. PATH and SUBDIR are of type CHARACTER and may be as long as 255 characters.
Example of using the FMTREE routine
* * Argument declarations PARAMETER (MAXDIR=1000) CHARACTER*255 PATH,SUBDIR(MAXDIR) * Get list of subdirectories down to a level of 10 CALL FMTREE('//CERN',SUBDIR,10,NFOUND,MAXDIR,IRC) IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMTREE'
Using FMLDIR as a replacement for FMTREE
* PARAMETER (MAXDIR=100) CHARACTER*255 CHDIRS(MAXDIR) ICONT = 0 * * On return, IRC = -1 if more than MAXDIR directories found. * Call FMLDIR again with ICONT ^=0 to retrieve the next * batch of MAXDIR directories * CALL FMLDIR('//CERN/DELPHI'// + '/ALLD/RAWD/CERN/V001/E091.00/P01R000314/NONE/*', + CHDIRS,NDIRS,MAXKEY,ICONT,IRC) IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMLDIR'
CALL FUALLO (MEDIA,VSN*,VID*,IRC*)
The suggested replacement for this routine is FMUALL, which is automatically called from FMALLO if FATMEN has been installed without the TMS option.
This routine returns a free VSN and VID of type MEDIA.
Example of using the routine FUALLO
* Argument declarations CHARACTER*6 VSN,VID CHARACTER*4 MEDIA MEDIA = '3480' CALL FUALLO(MEDIA,VSN,VID,IRC) IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FUALLO
CALL FMLIFT (GENAM,KEYS*,MEDIA,CHOPT,IRC*)
The suggested replacement for this routine and FMLINK is FMBOOK.
This routine will create a new ZEBRA bank for the specified generic name GENAM and fill in default values. The user may then modify these before committing the changes via FMPUT. If IRC is non-zero, the IQUEST vector will contain the error condition signaled by MZBOOK. See the description of MZBOOK in the ZEBRA manual. After calling the FMLIFT routine, the user must obtain the address of the associated bank using FMLINK and then fill in the appropriate media details using FMALLO or FUALLO. See on Page , on Page and on Page for further details.
Example of using the FMLIFT routine
CALL FMLIFT('//CERN/CNDIV/GOOSSENS/DCF/M123',KEYS,'DISK',' ',IRC)
FMLIFT returns warning conditions using the IQUEST vector. The following conditions may be reported:
CALL FMLINK (GENAM,LBANK*,CHOPT,IRC*)
This routine will return the address LBANK of the ZEBRA bank corresponding to the specified generic name GENAM. It should be called after FMLIFT if the user wishes to modify the information contained in the bank before committing the changes via FMPUT, or at the end of run when more details, such as file size, first and last event number, are known. If no bank exists for the specified generic name GENAM, warning messages will be printed and a bank address of zero returned. These messages may be suppressed by specifying the character option 'Q' (quiet), or globally by using FMLOGL described below. If no bank corresponding to the specified generic name GENAM is found, IRC will be non-zero.
Example of using the FMLINK routine
* Obtain address of bank previously lifted by FMLIFT CALL FMLINK('CERN/GOOSSENS/DCF/M123',LBANK,'Q',IRC) IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMLINK
CALL FMQTMS (VID,LIB*,MODEL*,DENS*,MNTTYP*,LABTYP*,IRC*)
This routine interfaces to the local Tape Management System and returns information on a given volume. Interfaces currently exist to the HEPVM TMS and VMTAPE.
If FATMEN has been installed without the TMS option, then default values will be returned. See the description of the FMEDIA routine for information on setting these default values. To allow this default information to be overridden on a volume by volume basis, FMQTMS calls a user exit FMUTMS which has exactly the same calling sequence. A dummy FMUTMS routine exists in PACKLIB.
Example of using the routine FMQTMS
* Definitions from FATMEN sequence TMSDEF CHARACTER*6 DENS CHARACTER*8 LIB CHARACTER*4 LABTYP CHARACTER*1 MNTTYP CHARACTER*8 MODEL CHARACTER*7 ROBMAN(2) DATA ROBMAN(1)/'-Robot '/,ROBMAN(2)/'-Manual'/ * * Obtain characteristics of volume I28901 * CALL FMQTMS('I28901',LIB,MODEL,DENS,MNTTYP,LABTYP,IRC) IF(IRC.EQ.100) PRINT *,'Volume unknown to TMS' IF(IC.EQ.0) THEN ITYPE = 1 IF(MNTTYP.EQ.'M') ITYPE = 2 PRINT *,'Library = ',LIB,' model = ',MODEL//ROBMAN(ITYPE) + ,' density = ',DENS,' label type = ',LABTYP ENDIF
Example of a user coded FMUTMS routine
SUBROUTINE FMUTMS(VID,LIB,MODEL,DENS,MNTTYP,LABTYP,IRC) CHARACTER*(*) VID +CDE,FATTYP. +CDE,TMSDEF. * * Return codes (HEPVM TMS convention) * 0 ok * 8 Syntax error * 12 Access denied * 100 Volume does not exist * 312 Volume unavailable * * The following test is CERN specific!!! * IF((VID(1:1).EQ.'I').AND.(ICNUM(VID,2,6).EQ.7)) THEN LIB = 'SMCF_1' MODEL = 'SMCF' MNTTYP= 'R' ENDIF END