MAINT Installation Guide Last update: 21-Sep-1988 Welcome to MAINT! First a little bit about what MAINT does. MAINT is a screen-oriented file and directory maintenance program. It will allow you to do all sorts of things to files and directories with just a few keystrokes. It also makes it easier to scan a bunch of directories and sub- directories very quickly. It has a number of different startup options for formatting the information on the screen and the a whole slew of commands that may be specified. I know the above paragraph seems a little sketchy but after you start using MAINT, I think that you will find that it can be a very useful tool. We have been using it for quite a while here and I have gotten a lot of positive feedback on it, including many suggestions for improving it. The idea for MAINT is not necessarily my own. I was influenced by a number of different packages that I have seen on many different machines. Nothing like it existed for VMS, however (at least not here!). I started writing it one day, borrowing all kinds of ideas from a very similar program that was written by a co-worker some time ago for our DECsystem-10. What's included with MAINT: --------------------------- The source code is included in case you want to see how some things are done or if you want to hack on it. I don't mind as long as the copyright notice (COPYRIGHT.TXT) stays with it if you give it to someone else and you don't claim you wrote it or try to make money from it. If you come up with a bug fix or a new feature, I'd be very interested in hearing about it. If you look at the source code, you might be surprised by the number of comments in the code. Call me over-zealous but I like comments in my code. Just the other day I was fixing some code that I had written about three months previous and I had a hard time figuring out what was happening. You will also see little comments in the code that look like "/*eject*/". These are just little preprocessor directives to a program that I use here to print it on the line printer; you can just ignore them if you want or maybe you could change them to form-feeds. Personally, I like to have all my listings such that all functions start on a new page :-). Source code ----------- MAINT.C main source file MAINT2.C secondary source file SUBS.C general-purpose subroutines MAINT.H MAINT's very own header file Object files ------------ MAINT.OBJ MAINT2.OBJ SUBS.OBJ CLD file -------- MAINT.CLD COM file -------- BUILD.COM HELP file --------- MAINT.HLP Miscellaneous header files -------------------------- ACLDEF.H UTYPE.H ITMLST.H FSCNDEF.H Miscellaneous files ------------------- MAINT.NEWS newsletter article ABSTRACT.TXT short abstract describing MAINT 000README.TXT this file! BUILD.OPT options file for LINK step Before building MAINT --------------------- Look at the file MAINT.H. There is a #define for EXTERNAL_HLB. Defining this will make MAINT use an external help library SYS$HELP:MAINT.HLB. Not defining it will make MAINT look in the standard VMS help library SYS$HELP:HELPLIB.HLB. My boss here doesn't like making our VMS help library too big, thus the external option. Installing MAINT ---------------- 1. Installing MAINT system-wide ------------------------------- You will need the following privileges to install MAINT: - SYSPRV - for copying stuff to SYS$SYSTEM: and modifying the system help library - CMKRNL - for running INSTALL These aren't the only two privileges that will work. BYPASS seems to work real well :-). You will also have to have SYS$LIBRARY:ACLEDTSHR.EXE installed for MAINT to work. Realize of course the MAINT doesn't need these privileges to run. You only need to have these priveleges to build and install the program system-wide. MAINT needs no privileges to run. 1. Building the executable (MAINT.EXE) A. To build MAINT from the sources, enter $ @BUILD B. To build MAINT from the object files, enter $ @BUILD OBJ 2. Copy MAINT.EXE to SYS$SYSTEM. $ COPY/PROT=(S:RWED,O:RWED,G:E,W:E) MAINT.EXE SYS$SYSTEM: 3. Run INSTALL to install MAINT.EXE (optional) $ INSTALL :== $INSTALL/COMMAND $ INSTALL INSTALL> ADD SYS$SYSTEM:MAINT.EXE/OPEN/HEADER/SHARE INSTALL> EXIT 4. Install the .CLD file. The following command should suffice: $ SET COMMAND/TABLE=SYS$LIBRARY:DCLTABLES/OUTPUT=SYS$LIBRARY:DCLTABLES - _$ MAINT Then run INSTALL and do a REPLACE on DCLTABLES. $ INSTALL :== $INSTALL/COMMAND $ INSTALL INSTALL> REPLACE SYS$LIBRARY:DCLTABLES.EXE INSTALL> EXIT 5. Install the help library. a) if you (1) built MAINT.EXE from the .OBJ files or (2) build from the the sources AND you did NOT #define EXTERNAL_HLB, install MAINT.HLP in the system help library SYS$HELP:HELPLIB.HLB: $ LIBRARY/HELP/INSERT SYS$HELP:HELPLIB.HLB MAINT.HLP Of course, you need exclusive access to HELPLIB.HLB before you can do this. I usually accomplish this by reprotecting it and then making sure no one is using it :-). b) if you didn't choose a), you must've built from the sources AND added #define EXTERNAL_HLB. In this case, you must first build a help library by entering $ LIBRARY/HELP/CREATE MAINT.HLB MAINT.HLP Now copy it out to SYS$HELP: $ COPY/PROT=(S:RWED,O:RWED,G:R,W:R) MAINT.HLB SYS$HELP: 6. Log out and log back in to get the new version of DCLTABLES or do the following command: $ SET COMMAND/TABLE=SYS$LIBRARY:DCLTABLES.EXE That's it! Enter "MAINT" and see what happens. Once you get in, you can press the Help key or just "h" for help. To quit, you can enter "q". You should also be able to enter "HELP MAINT" (if you installed the help file in SYS$HELP:HELPLIB.HLB or "MAINT/HELP" in either case. 2. Installing MAINT in your own area ------------------------------------ You're probably reading this section since you don't have permission to install MAINT system-wide. Take heart in the fact that MAINT can be installed in a local area (this is actually the way I debug it). To do it, however, you must rebuild from the sources (in other words, you must have a C compiler). Anyway, here's what you have to do: 1. In MAINT.H, enter the following line: #define EXTERNAL_HLB This will make MAINT look in it's own HELP library when you ask for it. Place this line as the first #define in the file. 2. In MAINT.C, find the definition of the helplib_d descriptor. It's actually inside of an #ifdef statement. It should look something like #ifdef EXTERNAL_HLB static $DESCRIPTOR(helplib_d,"SYS$HELP:MAINT.HLB"); #else static $DESCRIPTOR(helplib_d,"SYS$HELP:HELPLIB.HLB"); #endif Change the first definition from "SYS$HELP:MAINT.HLB" to where you want the help library to be in your area. 3. Create the help library: $ library/help/create your-help-library-name MAINT.HLP where "your-help-library-name" is the name of the MAINT.CLD file in your area. 4. Modify the .CLD file to point to the executable in your area. There is a line in the MAINT.CLD file that looks like image sys$system:maint.exe Change "sys$system:maint.exe" to be the name of the MAINT.EXE file in your area. 5. Do a SET COMMAND on the MAINT.CLD file in your LOGIN.COM so that it will be done every time you login. The form is just $ set command your-cld-file-name where "your-cld-file-name" is the name of the MAINT.CLD file in your area. 6. Rebuild MAINT from the sources by entering the command @build 7. Rename the MAINT.EXE file to match the change you made to the .CLD file. 8. Now either do a SET COMMAND MAINT or logout and log in to set up the .CLD file for MAINT. That's it! Enter the command $ MAINT and it "should" work. MAINT/HELP might be a good first command to try. Known glitches -------------- By doing HELP MAINT Caveats, you will get a list of the known "gotchas" that still exist in MAINT. Some of them I just haven't had time to work out; a few have either have me stumped on how to accomplish them or I know to do it but I haven't figured out WHERE to put it in MAINT. Hopefully, by the time I finally decide to quit playing with this thing, the list will be gone. There is probably an infinite number of little bugs (especially in the Expand command, although I think I have most of the information there) but I think that I weeded out quite a few of them. A word of advice about using MAINT ---------------------------------- Even though MAINT requires no privileges to run, watch out if you have privileges turned on. Once when I was testing MAINT I needed a directory that had a lot of files in it. Like a dummy I chose to use SYS$SYSTEM. Well, I had SYSPRV turned on and I had a bunch of files marked for deletion; I had no intention of deleting them, though. Anyway, the line to my terminal sometimes has a mind of its own and on this occasion, it spit out an "X" which means "execute the marks". After I opened my eyes, I realized that I had wiped out quite a bit of SYS$SYSTEM. It was after this fiasco that I added the /CONFIRM switch that asks if you REALLY want to execute commands. I defined MAINT to have the /CONFIRM switch in my LOGIN.COM after that and it has actually saved me from screwing up on more than one occasion. If you want to hack on the code ------------------------------- Look at MAINT.C for a little information about some of the data structures used and some built-in debugging mechanisms. The debugging mechanisms are really just some #ifdef'd code that makes it easier to run DEBUG on MAINT. If you have problems installing MAINT ------------------------------------- Feel free to call me or send me some e-mail and let me know how I blew it. I'll do what I can to make sure that MAINT can be installed at your site. Conclusion ---------- I put a lot of work into MAINT and I would appreciate any comments/suggestions/ flames that you might have. I'd like to keep track of where MAINT is being used for a couple of reasons: 1) this is my first submission to DECUS and I'm just curious about how many sites find this thing useful and 2) to send out any bug fixes that come up. I would appreciate it if you would either send me some e-mail to one of the addresses below or phoning me, letting me know that you installed MAINT and what your thoughts are about it. While I'm sure that there other products available that do about the same stuff that MAINT does, I still feel that you will find it useful. At any rate, I use it quite a bit, even if no one else does :-). ----- Leonard J. Peirce Internet: peirce@gw.wmich.edu Western Michigan University peirce@gumby.cc.wmich.edu Academic Computer Center Voice: (616) 387-5469 Kalamazoo, MI 49008