home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / fixcli_429.lzh / FixCLI / FixCLI.readme < prev    next >
Text File  |  1991-01-10  |  4KB  |  69 lines

  1.  
  2.                                   FIXCLI
  3.  
  4. The purpose of this program is to eliminate the trouble one has with starting
  5. up a new CLI (or Shell) from programs like PopCLI, DMouse, MyMenu, and others
  6. which allow you to run NewCLI without an existing CLI.  The trouble is that a
  7. new CLI will be created just fine, but that CLI will have no current
  8. directory and no command path.  If you ask it what the CD is, it will say
  9. "SYS:", but it is actually the root directory of the disk you booted from,
  10. even if SYS: has since been assigned elsewhere.  If you ask the path, it says
  11. "Current Directory" and "C:".  This is actually an empty path.
  12.  
  13. FixCLI fixes both the path and the current directory in one step.  It is
  14. intended to be placed in a CLI-Startup and/or Shell-Startup script.  It is
  15. "pure" and can be made resident.  If you already have a valid CD and a non-
  16. empty path, then FixCLI has absolutely no effect.
  17.  
  18. There are two versions of FixCLI.  The smaller and simpler one is a bit over
  19. 1k in size.  The fancier one, here called FixCLI-W (just rename it FixCLI if
  20. this is the one you want to use), is over 1.5k in size, and has one extra
  21. feature that many users will never need.  It is for use with CLI windows
  22. created elsewhere than on the Workbench screen, for instance, with "NewShell
  23. CON:S*/etc" using ConMan.  The problem is that system requesters such as
  24. "Please insert" will appear back on the Workbench screen.  FixCLI-W changes
  25. the CLI's WindowPtr value so that such requesters appear on the screen that
  26. the CLI's window is on.
  27.  
  28. What both versions of FixCLI do is check the current directory, and if it is
  29. zero, it tries to set the current directory to be the directory named in the
  30. command argument line.  For example, "FixCLI ram:" will CD to the ram disk,
  31. unless you have a valid current directory already.  Quotes are not necessary
  32. around a directory name with spaces in it, unless there is a space at one
  33. end.  If you don't name a directory, it CD's to the current SYS:.
  34.  
  35. It then checks to see if the path is empty, and if it is, it tries to copy
  36. the path known to the Workbench process, which got it from the initial CLI
  37. that ran LoadWB.  If you gave a Path command after the Workbench was already
  38. running, FixCLI won't know about it.  If the Workbench's path is empty or
  39. there is no Workbench, it tries to find another CLI to learn the path from. 
  40. First it looks for the initial CLI, then for a CLI created by NewShell, then
  41. for one made by NewCLI, and as a last resort it looks for a background CLI. 
  42. The copying of the path from another process is much quicker than using an
  43. actual Path command, because it does not read the disk.  
  44.  
  45. Note that the path aspect is independent of the CD aspect; each can happen
  46. without the other.  It returns 5 (WARN) when it sets either the current
  47. directory or the path.  It returns zero if it does neither.  If it tries to
  48. CD and the directory you name can't be found, it returns 10 (ERROR) and
  49. leaves the path unchanged.  The effect on the WindowPtr value, if FixCLI-W
  50. changes it, is not reflected in the return code.
  51.  
  52. When it sets the CD according to a command line argument, it copies the text
  53. of that argument into the SetName space.  This is what the Shell uses to show
  54. your current directory in the prompt.  The prompt will show the directory
  55. name as you typed it, not in the official form that the CD command would use.
  56. For example, "CD sys:utilities" might put "Workbench1.3:Utilities" in the
  57. SetName, but FixCLI would just put "sys:utilities".  It saves disk access
  58. to do it this way.  If you want to get the official string in there, you can
  59. give the command CD "" (set current directory to the empty string in quotes).
  60. Or you can just type it properly in the FixCLI command.
  61.  
  62. In my opinion, a proper s:CLI-Startup file contains exactly two commands:
  63. Prompt and FixCLI.  A proper s:Shell-Startup contains these two plus aliases.
  64.  
  65. To compile FixCLI-W, #define the name WINDOWPTR.  This can be done with the
  66. Aztec -d option.  I'm not sure if it will compile correctly with Lattice.
  67.  
  68. FixCLI is in the public domain, by Paul Kienitz.
  69.