home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gumby!destroyer!ubc-cs!mala.bc.ca!epp
- From: epp@mala.bc.ca (Lorne Epp)
- Newsgroups: comp.os.vms
- Subject: Re: DCL question again
- Message-ID: <1992Aug13.122817.671@mala.bc.ca>
- Date: 13 Aug 92 12:28:17 -0700
- References: <1992Aug13.164237.18724@uxa.ecn.bgu.edu>
- Organization: Malaspina College
- Lines: 26
-
- In article <1992Aug13.164237.18724@uxa.ecn.bgu.edu>, uucm000@uxa.ecn.bgu.edu (Tingli Pan) writes:
- > Here is another DCL question from me. (obvioustly I'm working in a small
- > DCL project) Is there a way to find whether a file is locked or not on
- > the DCL level.
- >
-
- Here is a quick'n'dirty command procedure to do the job. There may be a
- more elegant way, but this works:
-
- $open a_logical_name 'p1'/read/write/error=gak
- $close a_logical_name
- $exit
- $gak:
- $if $status .eq. %x1001828A
- $then
- $ write sys$output "Locked!"
- $else
- $ write sys$output f$message( $status )
- $endif
-
- You will probably want to include some boilerplate to ensure that
- you aren't using an already-assigned logical name (unlikely, though,
- when it has a dopey name like a_logical_name).
-
- ----------------------------------------------------------------------
- Lorne Epp epp@mala.bc.ca
-