Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!ucla-cs!zen!ucbvax!UTKCS2.CS.UTK.EDU!moore From: moore@UTKCS2.CS.UTK.EDU (Keith Moore) Newsgroups: comp.os.vms Subject: Re: VMS C SYS$OUTPUT Message-ID: <8709122354.AA26184@utkcsunix.CS.UTK.EDU> Date: Sat, 12-Sep-87 19:54:23 EDT Article-I.D.: utkcsuni.8709122354.AA26184 Posted: Sat Sep 12 19:54:23 1987 Date-Received: Sun, 13-Sep-87 10:45:32 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 34 In his message of 11 Sep 87, writes: >I have been using VAX C version 2.3 to write a program designed to be run >as a detached process. It runs fine, but VAX C insists on opening >SYS$OUTPUT and SYS$ERROR even though the program does not do any output. >There are no Output functions used in the program and when I run it /detached >it creates files called SYS$OUTPUT. and SYS$ERROR. Is there a way around >this? Is main() doing this? I can close the files with fclose(stdout) and >fclose(stderr) but that still leaves me with useless files in my directory. ...to which Carl J. Lydick responds: > If it sees a routine called "main" as the first routine in a module >it compiles, it has "main" call "C$MAIN" before it does anythhing else. >C$MAIN takes care of parsing the command line and opening the standard files.; [...] >As you may have gathered from the above, the way to avoid this unfortunate >(in a few cases; one that comes immediately to mind is a print symbiont) >state of affairs, just don't have a "main" routine. Bear in mind that this >also means you've got to parse the command line yourself. Also bear in mind that several of the C run time library routines will not work as expected unless C$$MAIN has been called. Whenever I write a VAX/VMS C program that doesn't run in the normal environment, I don't define the main() function, and I make sure that NO routines from the C run time library are linked in. Instead, I substitute routines I have written myself or calls to System Services, RMS, etc. On the other hand, perhaps there is an easier solution to your problem. Have you tried run/detached/output=nla0:/error=nla0: ? Keith Moore UT Computer Science Dept. Internet: moore@utkcs2.cs.utk.edu 107 Ayres Hall, UT Campus CSnet: moore@tennessee Knoxville Tennessee BITNET: moore@utkcs1