Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!styx!ames!ucbcad!ucbvax!RELAY.CS.NET!m1b%rayssd.ray%com.UUCP From: m1b%rayssd.ray%com.UUCP@RELAY.CS.NET ("M. Joseph Barone") Newsgroups: mod.computers.vax Subject: Submission for mod-computers-vax Message-ID: <8611181848.AA14527@rayssd.RAY.COM> Date: Tue, 18-Nov-86 13:48:46 EST Article-I.D.: rayssd.8611181848.AA14527 Posted: Tue Nov 18 13:48:46 1986 Date-Received: Fri, 21-Nov-86 07:02:03 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 49 Approved: info-vax@sri-kl.arpa Path: rayssd!m1b From: m1b@rayssd.RAY.COM (M. Joseph Barone) Newsgroups: mod.computers.vax Subject: VAX C chdir is defective with VMS V4.4 Keywords: chdir, VAXCRTL.OLB Message-ID: <399@rayssd.RAY.COM> Date: 18 Nov 86 18:48:27 GMT Sender: m1b@rayssd.RAY.COM (M. Joseph Barone @ Raytheon Company, Portsmouth RI) Organization: Raytheon Company, Portsmouth RI Lines: 39 This may be old news to some people but I thought I'd inform those who didn't know about this problem. The VAX C routine, chdir, doesn't seem to work properly under VMS V4.4. (Incidentally, the compiler is VAXC V2.2.) The following program, compiled with /DEBUG, will illustrate the point: main() { static char resstr[100]; strcpy (resstr,"dra0:[sys0.sysexe]"); if (chdir (resstr) == -1) printf ("Destination directory '%s'\n",resstr); strcpy (resstr,"sys$sysdevice:[sys0.sysexe]"); /* A */ if (chdir (resstr) == -1) printf ("Destination directory '%s'\n",resstr); } /* B */ If you step through the program to the line commented as /* A */, and then spawn a DIR, you get the expected output. If you step to /* B */, and spawn a DIR, the following errors are printed: DIRECT-E-OPENIN, error opening SYS$SYSDEVICE:[SYS0.SYSEXE] as input -RMS-F-DEV, error in device name inappropriate device type for operation When I contacted DEC, the person I spoke to seemed aware of the problem. He suggested using SYS$SETDIR, but this precludes portability and also doesn't work quite the same (it leaves you in the new directory while chdir returns you to the original directory after program termination). Our solution was to get backup copies of VMS V4.2 VAXCRTL.OLB, VAXCCURSE.OLB, and VAXCRTLG.OLB. I haven't SPRed this yet but I'll get around to it! Hope this helps someone. Joe Barone {allegra, cci632, gatech, ihnp4, linus, mirror, raybed2, umcp-cs}!rayssd!m1b m1b@rayssd.RAY.COM Raytheon Co, Submarine Signal Div., 1847 West Main Rd, Portsmouth, RI 02871