home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vms / 19807 < prev    next >
Encoding:
Text File  |  1992-12-23  |  1.0 KB  |  36 lines

  1. Path: sparky!uunet!pipex!bnr.co.uk!uknet!miclon!nreadwin
  2. From: nreadwin@micrognosis.co.uk (Neil Readwin)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: Problem with file open detection
  5. Message-ID: <BzqDzu.2pu@micrognosis.co.uk>
  6. Date: 23 Dec 92 21:21:29 GMT
  7. References: <1992Dec23.024625.20490@ee.ubc.ca> <1h9rbcINN1c9@gap.caltech.edu>
  8. Sender: news@micrognosis.co.uk
  9. Organization: Micrognosis, a division of CSK(UK) Ltd
  10. Lines: 24
  11.  
  12. In article <1h9rbcINN1c9@gap.caltech.edu>, carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick) writes:
  13. |> (I thought there was a "vmserr" variable, but a quick look at HELP CC
  14. |> RUN didn't show it [...]
  15.  
  16. Close, it's vaxc$errno. A C routine with a similar function to yours would
  17. be:
  18.  
  19. #include <stdio.h>
  20. #include <rmsdef.h>
  21. #include <errno.h>
  22.  
  23. int is_open(char *file_spec) {
  24.     int    x;
  25.     FILE    *f = fopen(file_spec, "a");
  26.  
  27.     x = ((f == NULL) && (errno == EVMSERR) && (vaxc$errno == RMS$_FLK));
  28.     if (f) fclose(f);
  29.     return x;
  30.     }
  31.  
  32. Neil.
  33. -- 
  34.  Phone: +44 71 815 5283  E-mail: nreadwin@micrognosis.co.uk
  35.  Anything is a cause for sorrow that my mind or body has made
  36.