home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vms / 19825 < prev    next >
Encoding:
Internet Message Format  |  1992-12-24  |  2.1 KB

  1. Path: sparky!uunet!olivea!charnel!rat!ucselx!crash!cmkrnl!jeh
  2. From: jeh@cmkrnl.com
  3. Newsgroups: comp.os.vms
  4. Subject: Re: Detecting directory of invoked .com
  5. Message-ID: <1992Dec23.203029.1002@cmkrnl.com>
  6. Date: 24 Dec 92 04:30:28 GMT
  7. References: <1992Dec23.160636.27010@tigger.jvnc.net>
  8. Organization: Kernel Mode Consulting, San Diego, CA
  9. Lines: 42
  10.  
  11. In article <1992Dec23.160636.27010@tigger.jvnc.net>,
  12.  fogelinc@nmr1.Cyanamid.COM (Carl Fogelin) writes:
  13. > At the risk of being flamed by the "active" participants of this Sig, I have
  14. > a problem which I hope has a reasonable answer.
  15.  
  16.     Oxidizer and napalm tanks full        check!
  17.     Pressure tank charged            check!
  18.     Igniter charged                check!
  19.     Safety off                che
  20.  
  21. ... oops, sorry, got carried away there.
  22.  
  23. > In a DCL program, I would like to be able to determine what directory the
  24. > invoked .com file is located in.  I seem to remember a similar thread about
  25. > 6 - 8 months ago, so I hope someone remembers the solution.
  26.  
  27. General rule of DCL command procedures:  If you want information about 
  28. something -- almost anything -- look at lexical functions.  HELP LEXICALS
  29. gives you a complete list.  Unfortunately this is one of those cases where
  30. you have to know the name by which VMS refers to something before you can
  31. go looking for it. 
  32.  
  33.     f$environment("PROCEDURE")
  34.  
  35. will return the complete file specification of the command procedure from
  36. which it is invoked.  To get just the device and directory name, you can
  37. parse this out yourself with just a few quick strokes of f$element, but
  38. f$parse will do it for you:
  39.  
  40.     $ comfile = f$environment("PROCEDURE")
  41.     $ comfile_dev = f$parse(comfile,,,"DEVICE")
  42.     $ comfile_dir = f$parse(comfile,,,"DIRECTORY")
  43.  
  44. For more information, see HELP LEXICALS F$ENVIRONMENT or ... F$PARSE.
  45.  
  46.     --- Jamie Hanrahan, Kernel Mode Consulting, San Diego CA
  47. drivers, internals, networks, applications, and training for VMS and Windows-NT
  48. uucp 'g' protocol guru and release coordinator, VMSnet (DECUS uucp) W.G., and 
  49. Chair, Programming and Internals Working Group, U.S. DECUS VMS Systems SIG 
  50. Internet:  jeh@cmkrnl.com, hanrahan@eisner.decus.org, or jeh@crash.cts.com
  51. Uucp:  ...{crash,eisner,uunet}!cmkrnl!jeh
  52.