Rem

4640 NEXT:PRINT

4650 CL0SE1:GET 2,DS:LSET XLS-MKSS(CC1):PUT 2,DS:TL—1:NC-0:PRIN

TCHRS( 17) ;: EN-DS:GOSUB870 :GOTQ4170 Listing continued log. Messages, as discussed in some detail earlier, take on secret file names. The idea is to never give a caller access to the real file names on the disk; otherwise, your system is much too vulnerable.

Each data base file, then, has a public file name and a secret file name. The BBS builds the secret file name from the data base file number, XAx-xx/BBS, in the same way that it builds the message file. The first file is XA001/BBS, the second XA002/BBS, and so on. One advantage of this method is that your public file names aren't limited to legal TRSDOS file names; you're allowed 20 characters, all of which are legal.

Binary Trees Revisited

In creating the data base catalog, you'll also use the binary tree method that was used to find files in the membership log (February 1985, p. 104). You must make each file name unique, though, because duplicate file names might confuse the tree. When a caller orders an upload, he's first prompted for a file name, which is then evaluated for originality.

Lines 3760-3850 of the Program Listing perform this operation. In addition, since you're maintaining your own directory, line 3810 makes it possible to include information such as descriptions, which aren't normally included in a DOS directory.

Line 3860 builds the secret file name by calling the same routine that creates the secret names for the message board. If SY = - 1, line 3870 gives you the option of password protecting the file you're about to upload. If the file's password is anything but "Password," it's not visible on the catalog.

Line 3880 bumps the data slot (DS) by 1, and puts the information for this file in XASPACE/BBS. DS is the number of the last record used in XASPACE/BBS. Line 3920 opens the secret file, A$, while line 3920 calls the telecommunicating input statement. Each call stores up to 255 characters in 1$, and then exits after sending an XOFF. If the line begins with /EX (or /ex), the BBS terminates the routine in line 3930. Otherwise, you'll use PRINT#3 to write the string to the secret file, and bump CC! by the value of CT, the character count.

When the caller signals his exit with

Was this article helpful?

0 0

Post a comment