PWD V 2.0 From: Al Hawley, Znode 2 (Ladera Znode), (213)-670-9465 Date: 10/25/89 Credits and thanks to Jay Sage, Cameron W. Cotrill, and Howard Goldstein for help in design and debugging. I always feel secure after Howard has picked the flaws out of a program! A few weeks ago, one of my Znode callers complained about PWD. It seems that he has a LARGE number of directories on his HD, and the PWD display simply vanished off the top of the screen before it stopped! It touched a nerve. I intentionally keep the NDR small, and load a new one when my attention needs to turn to system areas not 'named' in the current NDR. Awkward, but it works. So I put paging into PWD for him. And then I began to consider, with considerale prompting from Jay Sage and Cam Cotrill, OTHER ways of managing the PWD display. During the last year, Cam and I have been swapping ideas for a Finite State Machine. An FSM is ideally suited for implementing a command tail parser; in fact, that's how really complex parsers for such things as compilers work. "When you get a new hammer, all the World looks like a nail!" Since the OTHER ways of managing PWD displays involved a new syntax that would be tedious to write (and change when users don't like it!), the new PWD looked like an ideal "nail" for the FSM "hammer"! The results are in this package. The source for PWD is no longer just one file, although it COULD be melted together. Instead, the FSM is a separately assembled file, FSMACH.Z80. Similarly, the State Tables and their support routines are another file, PWDCMD,Z80. They are combined during linking with the main PWD.Z80 assembly. A third component, BITS.Z80, contains some handy bit-twiddling routines imported from ARRAYS.LBR for manipulating bits in drive vectors. The syntax for PWD2 is described below. It is very forgiving; by design, PWD2 does two things: displays the directories, or displays HELP. No error messages. To display directories and password, the original syntax was: PWD P This has been changed in the new version to PWD /P which, in addition to being consistent with other Z utilities, removes a parsing problem. (The letter P is also a drive letter!) PWD2 takes an indefinite number of arguments, in any order. Easy, with the FSM. This means that a command line like PWD // /P will result in nothing but a help screen display. The parser detects the '//' and acts on it. Here's the syntax. Many other changes (not mentioned here) are to be found in PWD.HST. If you have a terminal that supports 132 column mode, set it up that way (don't forget to tell Z3ENV about the change!) and then give PWD a try. PWD ajdusts the display for current screen size. Syntax: PWD [...] There are 3 argument types, identified as follows: : terminator indicates drive selection list / The only options is P'. Anything else is a HELP invocation. a set of characters from which a legal file name could be made. No delimiters. This is automatically wild-carded as if '*' had been appended. If the argument has more than 8 characters, only the first 8 are used. The rest are ignored. whitespace is spc, tab, comma, and CR (after last argument) and /o are terminated by whitespace : may be followed by whitespace, but it's not required may be a list of one or more of the letters A...P the list may include a range like B-F examples of valid drive lists: a: bcd: B-FM: A-CJ-M: HBJMF: a tilde causes subsequent members of the list to be excluded for example: ~bc: (no display for drives B and C) ~AH-P (no display for drives A and H through P) arguments may be in any order, and may be repeated if separated by whitespace. A-P: ~lmno: displays all drives except L,M,N, and O. Whitespace is not required after a colon; A-P:~LMNO: is the same as the previous example. OTHER THINGS IN THIS LIBRARY PWD is configurable with ZCNFG.COM and the configuration overlay PWD.CFG. The overlay is included here; ZCNFG is readily available from Znodes. The source files for PWD.CFG are included in PWDCFG.LBR which is also included here. These files provide a simple example for making .CFG files, should you like to build one for some other program, or even expand on PWD's configuration options.