============================================================================ This PPE is designed to allow the Sysop to automatically generate PCBoard-format DIR files on-the-fly from a DIR listing. It's designed to be run whenever new files are copied into directories, and will list all available files, their size and the file date. At the end of the file it will list a total number of files and a total size for all files contained within the directory. ============================================================================ INSTALLATION: To install, first create a directory called \PCB\PPE\FLYDIR and move the files you unzipped from this archive into it. Then go into PCBSetup and to the conference where you'd like this to work. Edit the DIR.LST file and make it something like this: DIR.LST Editor Main Board DIR Text File Name & Path Hard Disk Subdirectory Sort ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÍÍÍÍ 1) C:\PPL\FLYDIR\DIR1 G:\DEMO\ 1 2) C:\PPL\FLYDIR\DIR2 G:\145TEXT\ 1 3) C:\PPL\FLYDIR\DIR3 G:\142TEXT\ 1 4) C:\PPL\FLYDIR\DIR4 G:\DOORGAME\ 1 5) C:\PPL\FLYDIR\DIR5 G:\READERS\ 1 This is all pretty standard. Where the big changes come in is in the DIR files themselves. Instead of using PCBFiler to edit them and create them, use any standard text editor and make them look like this: !c:\pcb\ppe\flydir\flydir.ppe 1 This is the only line you need to have in the file. The number following the name of the PPE needs to reflect the DIR number. In other words, DIR1 is shown above, DIR2 would look like this: !c:\pcb\ppe\flydir\flydir.ppe 2 and so on, through all of your DIR files. Once you've got this done, that's all it takes. When one of your callers requests a file list, it will be built on-the-fly, and will show all files you have in the directory. This will not use any FILE_ID.DIZ descriptions, it will only display the file name, file size and file date. Since it's created when it's asked for, it's always up to date, and you never have to maintain anything. Since this is not a DIR file, PCBoard can't colorize it on the fly. If you want the file information to be displayed in color, you'll have to enter the color codes into the PPE and recompile it. I left it in black and white, but the source code is in there, and you're free to change it any way you'd like. IF YOU MODIFY THIS SOURCE CODE AND WISH TO UPLOAD IT TO SALT AIR DO NOT UPLOAD IT AS A LATER RELEASE OF THIS PPE - UPLOAD IT AS YOUR PACKAGE. You may give me credit for the base code, if you wish, but I don't want to be called and asked why your version of this isn't working as advertised. ============================================================================ EXPLAINING THE CODE: -Declare the variables: String Files,LSTFile,DIRFile,DIRSub,CNames,Found,Desc,Line Integer i,Temp,Sort,Dir Int C_Size -Find out the location of the CNAMES file by reading the PCBOARD.DAT file. CNames = ReadLine(PCBDat(),31)+".@@@" -Open the CNAMES.@@@ file and read the location of the DIR.LST file from -it. The CNAMES.@@@ file is faster to read, because it is a binary file, -and retreiving information from a binary file is faster than retrieving it -from an ASCII file. FOpen 1,CNames,O_RD,S_DN FRead 1,C_Size,2 FSeek 1,((C_Size*CurConf())+484),Seek_Set FRead 1,LSTFile,33 FClose 1 -Open the DIR.LST file and read in the information for the first DIR file -and associated subdirectory. This PPE uses the FINDFIRST() and FINDNEXT() -functions to get a list of files in the directory. By using the FILEINF() -function, you get the file size and date. FOpen 1,LSTFile,O_RD,S_DN -Search through the DIR file to the correct position for this request and -read in the information for subdirectory and description. The other is -read in just for convenience's sake. FSeek 1,((Dir-1)*96),Seek_Set FRead 1,DIRFile,30 FRead 1,DIRSub,30 FRead 1,Desc,35 -Because when we read information in from a binary file, it contains ALL -the information - including spaces - it's necessary to strip off the spaces -from the end of the line. The STRIP() function is designed for that. It -will strip out any occurance of a character, anywhere it appears in a -string. DIRSub = Strip(DIRSub," ") -This line is where we find the first file in the directory. For reasons unknown to lowly non-programmers like me, it takes a different function to find the first file than it takes to find every subsequent file. This works, the programming department has told me it has to be like this - who am I to argue? Found = FindFirst(DIRSub+"*.*") -The line must be formatted properly as a PCBoard-style DIR file in order -for things like the FLAG PPE (allows flagging a file by using the space bar -available on Salt Air as FLAG32.ZIP). This line formats the information -retrieved and prepares it to be inserted into the new DIR file. Line = Left(Found,12)+Right(String(FileInf(DIRSub+Found,4)),9)+Space(2)+String(FileInf(DIRSub+Found,2)) -Once we've used the FINDFIRST() function, we then use the FINDNEXT() -function for all subsequent files. As long as FINDNEXT returns file name -information (while it's not equal to "", or blank) we'll continue in this -loop, constantly getting new file names and printing the formatted text to -the screen. While (Found <> "") do Found = FindNext() Line = Left(Found,12)+Right(String(FileInf(DIRSub+Found,4)),9)+Space(2)+String(FileInf(DIRSub+Found,2)) If (Found <> "") PrintLn Line Endwhile -This is the end of the code.