home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / qutil2.zip / qwhich.doc < prev    next >
Text File  |  1993-04-23  |  3KB  |  69 lines

  1.  
  2.  
  3.                        QWHICH (OS/2) - 1.00
  4.                           Documentation
  5.  
  6.     Copyright 1992-1993, Thomas G. Harold, All Rights Reserved.
  7.  
  8.  
  9.     QWHICH execfile
  10.         execfile - Name of the executable file to search for
  11.             in the PATH statement directories.  The name must not
  12.             include an extension, and must be 8 characters or less.
  13.             Wildcards are allowed.
  14.  
  15.     QWHICH is part of the QUTIL2 utilities package and may not be 
  16. distributed seperately.
  17.     QWHICH is a program that will scan the directories specified
  18. in the OS/2 PATH statment for executable files that match the
  19. execfile argument.  Matching files will be printed to the screen
  20. or redirected to a file.
  21.     QWHICH is useful for finding executable files that may "hide"
  22. one another because they were given the same name.  Although this
  23. is not as big of a problem under OS/2, it still can crop up.
  24.  
  25. -----------------------------------------------------------------
  26.  
  27. I.  Installation:
  28.  
  29.     Copy the qwhich.exe file to a directory in your PATH statement.
  30.  
  31. II.  Explanation:
  32.  
  33.     When an user types a command at the OS/2 prompt, OS/2 attempts
  34. to locate an executable file of the same name to execute.  The 
  35. first step that OS/2 takes is to check whether the command is one
  36. of its internal commands such as DIR, SET, ECHO.  If the command
  37. is not one of OS/2's internal commands, then OS/2 checks the current
  38. directory for the executable file.  If the executable file is not
  39. found in the current directory, then OS/2 proceeds to search all
  40. of the directories in the PATH statement until it finds a match.
  41.     The problems used to start under DOS because DOS would saw off
  42. any extension that you might add to the filename.  For example,
  43. it would turn the command, "MORE.COM", into "MORE".  Thus the
  44. commands "MORE.BAT", "MORE.COM", "MORE.EXE" all get turned into
  45. "MORE".  After sawing off the extension, DOS appends one of three
  46. proper extensions and searches for the file in each directory.
  47. The order of precedence among the three proper extensions is,
  48. (from first to last), ".EXE", ".COM", and ".BAT".  This resulted
  49. in the file "MORE.BAT" being masked by "MORE.COM", both of which
  50. are  masked by "MORE.EXE" if it exists.  So even if you specify
  51. that you wanted to execute "MORE.COM", "MORE.EXE" would be 
  52. executed instead if it is in the same directory as "MORE.COM".
  53.     OS/2 avoids this problem by not sawing off the extension,
  54. but would still follow rules of precedence if the extension is
  55. not supplied.  So even though QWHICH was originally written to
  56. solve the DOS extension problem, it is still useful under OS/2
  57. for checking for executable files which have the same name.
  58.  
  59. -----------------------------------------------------------------
  60.  
  61. History:
  62.  
  63.         1.00    Oct 1992
  64.             Original release version.
  65.  
  66.         1.00    Apr 1993
  67.             Ported to OS/2
  68.  
  69.