home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!usenet.ins.cwru.edu!agate!ucbvax!U.WASHINGTON.EDU!DEREK
- From: DEREK@U.WASHINGTON.EDU
- Newsgroups: comp.os.vms
- Subject: Re: Detecting directory of invoked .com
- Message-ID: <A3D6046EF3BF20503E@MAX.U.WASHINGTON.EDU>
- Date: 28 Dec 92 19:16:00 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: world
- Organization: The Internet
- Lines: 49
-
- Carl Fogelin (fogelincc@cyanamid.com) asked:
-
- >In a DCL program, I would like to be able to determine what directory the
- >invoked .com file is located in.
-
- Several people gave solutions to Carl's problem by suggesting the use of
- the F$ENVIRONMENT() lexical function, e.g., F$ENVIRONMENT("PROCEDURE").
- A couple of respondents indicated that you can use the F$PARSE() lexical
- function to easily extract the DIRECTORY portion of the returned file
- specification.
-
- (One side note: of the eight responses I have seen to date, only Jamie
- Hanrahan included any humor. Good job, Jamie!)
-
- Although a few posters also mentioned using F$PARSE() to extract the
- DEVICE portion of the file-spec, no one really was specific as to WHY
- this information might be useful. The point is that the DIRECTORY name
- may not supply sufficient information to distinguish between the two
- installations. For example, if the test code is in DISK$TEST:[CARL] and
- production code is in DISK$PRODUCTION:[CARL], then in is clear that you
- ALSO need to know the DEVICE names.
-
-
- Nonetheless, the answers are still incomplete. It may be that the device
- name used is something like PRODUCT$DEVICE:[CARL], where the definition
- of PRODUCT$DEVICE is different for the two installations. The better
- solution, I would think, would be to use the NO_CONCEAL argument to the
- F$PARSE() lexical function. For example, try the following five line
- command procedure and compare the output.
-
- $ write sys$output f$parse(f$env("procedure"),,,"device")
- $ write sys$output f$parse(f$env("procedure"),,,"directory")
- $!
- $ write sys$output f$parse(f$env("Procedure"),,,"device","no_conceal")
- $ write sys$output f$parse(f$env("procedure"),,,"directory","no_conceal")
-
- I am not going to claim that this is absolutely the BEST solution. I
- will, however, argue that it is a more complete solution that those which
- have previously been offered.
-
- -Derek S. Haining
- University Computing Services
- University of Washington
- Seattle, Washington 98195
- (206) 543-5579
-
- DEREK@MAX.BITNET
- DEREK@MAX.U.WASHINGTON.EDU
-
-