15. Using filenr.lis, DIRF and DELF

DIRF

The DIRF command is a useful program for making a file with a numbered list of files from a directory. The command makes a file with file name filenr.lis e.g. when working with many waveform files with long names, a DIRF is first made, and subsequent programs then get file names from filenr.lis, either by using the whole list, or just a given number. This is handled with routine filename (in LIB). Below are some examples of using DIRF with SEISAN data files.

 dirf 9101-10* 
 #  1  9101-10-0915-15S.KMY_01
 #  2  9101-10-1510-55S.N2F_08
 #  3  9101-10-2333-44S.N3F_06 


 dirf 9101-10-0915-15S.KMY_01 9101-10-2333-44S.N3F_06           

 #  1  9101-10-0915-15S.KMY_01
 #  2  9101-10-2333-44S.N3F_06

The wildcard `*' above indicates that all files from the 10'th is wanted. Many programs use the same subroutine to get the file name from filenr.lis. This means that most programs using filenr.lis assume that if a name given is less than or equal to 4 characters, it is a number so file names less than 5 characters cannot be used when the program asks for “Filename or number”. For a very long listing it might be an advantage to only get the first or the last 20 files and dirf has the corresponding options -head and -tail respectively. This argument must be the first argument like dirf -tail *.txt.

DIRF is dimensioned to a maximum of 99999 files.

DELF

DELF is a simple program that allows the user to delete a file that is listed in a filenr.lis file or another index file. First run DIRF to list the files that you want to delete. Then start DELF and choose the number of the file to delete, `?' shows the contents of filenr.lis. In addition, DELF also has an option to delete all the files in the filenr.lis or index file. This is a useful option if selected files in a data has to be deleted. If e.g. all S-files from a particular agency has to be removed, run SELECT first and then DELF.