home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / vms / 13621 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  1.2 KB

  1. Path: sparky!uunet!gumby!destroyer!ubc-cs!mala.bc.ca!epp
  2. From: epp@mala.bc.ca (Lorne Epp)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: DCL question again
  5. Message-ID: <1992Aug13.122817.671@mala.bc.ca>
  6. Date: 13 Aug 92 12:28:17 -0700
  7. References: <1992Aug13.164237.18724@uxa.ecn.bgu.edu>
  8. Organization: Malaspina College
  9. Lines: 26
  10.  
  11. In article <1992Aug13.164237.18724@uxa.ecn.bgu.edu>, uucm000@uxa.ecn.bgu.edu (Tingli Pan) writes:
  12. > Here is another DCL question from me. (obvioustly I'm working in a small
  13. > DCL project) Is there a way to find whether a file is locked or not on
  14. > the DCL level.
  15. >  
  16.  
  17. Here is a quick'n'dirty command procedure to do the job.  There may be a 
  18. more elegant way, but this works:
  19.  
  20.     $open a_logical_name 'p1'/read/write/error=gak
  21.     $close a_logical_name
  22.     $exit
  23.     $gak:
  24.     $if $status .eq. %x1001828A
  25.     $then
  26.     $    write sys$output "Locked!"
  27.     $else
  28.     $    write sys$output f$message( $status )
  29.     $endif
  30.  
  31. You will probably want to include some boilerplate to ensure that
  32. you aren't using an already-assigned logical name (unlikely, though,
  33. when it has a dopey name like a_logical_name).
  34.  
  35. ----------------------------------------------------------------------
  36. Lorne Epp                                               epp@mala.bc.ca
  37.