home *** CD-ROM | disk | FTP | other *** search
- __
- -------- Swap order of two message and/or file areas / \ Micro
- OASWAP for Opus 1.1x sysops, v01 released 22-APR-91 \__/ Magic
- -------- Copyright 1991 by Keith Ford (1:373/12) [__] BBS
-
-
- OASWAP will allow an Opus sysop to interchange the order of two
- system areas. Message and File information can be swapped individually
- or together.
-
- I wrote OASWAP to help keep my areas in a sensible (to me) order.
- My file areas are fairly stable, but I am always adding and removing
- echos. OASWAP allows me to rearrange message area order without
- disturbing my file area order.
-
- FREQ the latest version from 1:373/12 with magic word OASWAP. Send
- comments, bug reports, and suggestions here as well.
-
- A test mode is available where OASWAP will not execute the command
- but simply display what would be done. Option '-T'.
-
- A quick list option will display a quick list of the titles for all
- of the message and file areas. Option '-L'.
-
- Options allow Alternate Menus, Barricade File Path, and Area Attributes
- to be moved also. Option '-I{MBA}'.
-
- The last read pointers and the last message area accessed pointer can
- be updated as well. Option '-U'.
-
- I don't use alternate menus or barricade file paths, so OASWAP may
- need some enhancements to better handle these. Please let me know if
- you have ideas. Although they are options, I cannot think of a reason
- why you would swap message areas and not swap area attributes or update
- the last read pointers. OASWAP will spit out a warning if you do
- decide to not use these options when swapping message areas.
-
- OASWAP must be run in the directory where your SYSTEM##.DAT and USER.DAT
- files are located.
-
- OASWAP will only swap two existing areas. If you want to move an area
- out of the way for a moment, you will need to create a dummy area with
- something like OMAN and put it out of the way.
-
- Note, at most, the only files modified by OASWAP will be OASWAP.LOG,
- SYSTEM##.DAT, and USER.DAT. Any programs or files that make use of
- area numbers may require updating to work properly with your newly
- reordered areas. The following are known to have dependencies on
- this information:
-
- FILES PROGRAMS
- ~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
- ECHO.CTL KRAMMAIL
- BBS.CTL O_RENUM
- XLIST
- OPUS-FAM
-
-
- Entering OASWAP without any arguments will cause a usage screen
- to display. This screen is shown below.
-
- Usage: OASWAP area# area# [-M] [-F] [-I{MBA}] [-U] [-T] [-L]
-
- area# : decimal (not hex) value for area number
- -M : swap the message information
- -F : swap the file information
- -I : include the following in the swap
- M : alternate menu file extension
- B : barricade file path
- A : area attributes (message types)
- -U : update last read pointers in user database
- -T : test mode, show what would be done, but don't do it
- -L : quick list all areas (other arguments ignored)
-
- The author, an Opus sysop himself, recommends you make backup copies
- of certain files before using OASWAP. I performed CRC checks on these
- files, ran OASWAP a number of times, used the log to undo everything,
- and re-ran the CRC checks. Everything returned to it's original state.
- I trust OASWAP, but I had this uncle named Murphy that once said... <grin>
-
- Make backups of - all SYSTEM##.DAT
- - USER.DAT
-
- OASWAP.LOG will record all commands that are executed along with the
- date and time. If the command fails, it will be noted with a reference
- to a command failure note listed in this document. Replaying these
- commands in 'reverse' order will UNDO changes you have made, assuming the
- failures are not fatal to the system. Keep backups!
-
- Programmers note:
- If you look at the Otoolkit data structures, the "Reserved filler"
- elements are not modified or moved. I assume they are empty.
-
- If the command fails, it will list a note number to refer to. To better
- understand the extent of this failure, here is psuedo code for that part
- of the program.
-
- open SYSTEM##.DAT for first area, if error quit with failure(0)
- write to SYSTEM##.DAT for first area, if error quit with failure(1)
- close SYSTEM##.DAT for first area, if error quit with failure(2)
- - by this time, half the swap has been completed
- open SYSTEM##.DAT for second area, if error quit with failure(3)
- write to SYSTEM##.DAT for second area, if error quit with failure(4)
- close SYSTEM##.DAT for second area, if error quit with failure(5)
- - by this time, the swap is nearly complete
- open USER.DAT to update pointers, if error quit with failure(6)
- - swap completed successfully
-
- COMMAND FAILURE NOTES: If you receive one of these failures, you
- should try to determine why OASWAP had problems with the file
- I/O operations being attempted. Failures 1-7 may have caused some
- damage to the data files you were asked to back up eariler.
-
- 0 - failed trying to open SYSTEM##.DAT file for first area
- 1 - could not write to SYSTEM##.DAT file for first area
- 2 - could not close SYSTEM##.DAT file for first area,
- 3 - could not open SYSTEM##.DAT file for second area
- 4 - could not write to SYSTEM##.DAT file for second area
- 5 - could not close SYSTEM##.DAT file for second area
- 6 - could not open USER.DAT
- last read pointers and last message area accessed pointer not updated
- 7 - fseek to modify a user record in USER.DAT failed
-
-
- For whatever it is worth, here is a list of possible error and warning
- messages that OASWAP may produce.
-
- ** ERROR: extra -T argument found
- ** ERROR: extra -U argument found
- ** ERROR: extra -F argument found
- ** ERROR: extra -M argument found
- ** ERROR: extra -I argument found
- ** ERROR: extra (-I)A argument found
- ** ERROR: extra (-I)B argument found
- ** ERROR: extra (-I)M argument found
- ** ERROR: unknown -I argument
- ** ERROR: extra area number argument found
- ** ERROR: unknown argument
- ** WARNING: attributes not being moved with message areas
- ** WARNING: lastread pointers not being updated for moved message areas
- ** ERROR: message area not being moved with attributes
- ** ERROR: lastread pointers being updated for unmoved message areas
- ** ERROR: no -M or -F specified
- ** ERROR: no area numbers specified
- ** ERROR: only one area number specified
- ** ERROR: same number specified for both areas
- ** ERROR: cannot open area1 for write
- ** ERROR: cannot open area2 for write
- ** DATA OKAY (see documentation note 0)
- ** ERROR: cannot write to filename1
- ** DATA MAY BE CORRUPTED (see documentation note 1)
- ** ERROR: cannot close filename1
- ** DATA MAY BE CORRUPTED (see documentation note 2)
- ** ERROR: cannot open filename2 for write
- ** DATA MAY BE CORRUPTED (see documentation note 3)
- ** ERROR: cannot write to filename2
- ** DATA MAY BE CORRUPTED (see documentation note 4)
- ** ERROR: cannot close filename2
- ** DATA MAY BE CORRUPTED (see documentation note 5)
- ** ERROR: cannot open USER.DAT for modification
- ** DATA MAY BE CORRUPTED (see documentation note 6)
- ** ERROR: fseek failed in USER.DAT
- ** DATA MAY BE CORRUPTED (see documentation note 7)
-
- Enjoy!
-