============================================================================ 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. ============================================================================ INSTALLATION: To install, first create a directory called \PCB\PPE\MKDIR and move the files you unzipped from this archive into it. Then go into PCBSetup:File Locations:Configuration Files, and move your cursor to the CMD.LST field. Hit F2 to edit the file. You'll see a screen like this: CMD.LST Editor Charges Per PPE/MNU File Specification -or- Command Sec Minute Use Keystroke Substitution ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÍÍÍ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 1) LEFT 0 0 0 C:\PPL\TIME\TIME.PPE Hit Alt+I to insert a new line, and put in an entry like this: CMD.LST Editor Charges Per PPE/MNU File Specification -or- Command Sec Minute Use Keystroke Substitution ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÍÍÍ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 1) LEFT 0 0 0 C:\PPL\TIME\TIME.PPE 2) MKDIR 110 0 0 C:\PCB\PPE\MKDIR\MKDIR.PPE The command field is what you'll type to execute the PPE while logged in to the board. The Sec field is the minimum security level required for this command. Level 110 is the default security level for Sysop-level access. If your system is configured differently, adjust this entry to your Sysop-level security. The PPE/MNU File Specification field is the files you've just put into your new directory. Once logged into the board, you can execute this command and it will re-create all opf your DIR files within the conference where the command is executed. NOTE: This is a destructive process - any previous entries in your DIR files will be removed, and the DIR file completely re-built by this PPE. It will always reflect ONLY those files that are actually available within the directory. There will also be no file descriptions available - this does not attempt to make use of the FILE_ID.DIZ file contained within any archive file. ============================================================================ EXPLAINING THE CODE: -Declare the variables: String Files,LSTFile,DIRFile,DIRSub,CNames,Found,Desc,Line Integer i,Temp,Sort 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 -By using the size of the DIR.LST file and dividing it by 96 (the size of a -single record entry in DIR.LST) we get the number of entries in the DIR.LST -file. For i = 1 to (FileInf(LSTFile,4)/96) FRead 1,DIRFile,30 FRead 1,DIRSub,30 FRead 1,Desc,35 FRead 1,Sort,1 -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," ") -By using FCREATE, instead of FOPEN, we insure that the file is newly -created every time. If you used FOPEN, it would try to write over the old -information. That could get messy, and it wouldn't be recommended. FCreate 2,DIRFile,O_RW,S_DN -The PRINTLN is strictly cosmetic. I found it can take anywhere from a few -seconds to a few minutes to go through the whole DIR.LST file, and seeing -something new popping up on the screen gave me something to know it was -working, not locked up, while I was writing and testing it. You can leave -it in, or remove it. PrintLn "@X0ECreating: ",DIRFile 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)) FPutLn 2,Line -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 inserting the formatted text -into the DIR file. 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 <> "") FPutLn 2,Line Endwhile -At the end of each directory, FINDNEXT() will return a blank for the file -name. At that point, we close the DIR file we've been creating and go back -into the FOR/NEXT loop, to open up the next DIR file and start creating it. FClose 2 Next