Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!bonak%cs.uiowa.edu@RELAY.CS.NET From: bonak%cs.uiowa.edu@RELAY.CS.NET (Esmail Bonakdarian) Newsgroups: comp.lang.c Subject: 2 questions (Turbo C) Message-ID: <9034@brl-adm.ARPA> Date: Fri, 28-Aug-87 01:25:57 EDT Article-I.D.: brl-adm.9034 Posted: Fri Aug 28 01:25:57 1987 Date-Received: Sat, 29-Aug-87 17:15:11 EDT Sender: news@brl-adm.ARPA Lines: 30 I am using Turbo C and have the following problem trying to open a file in a program: if ( (infile = fopen("c:\temp\helpfile", "r")) == NULL ) { fprintf(stderr, "Input file HELPFILE not found."); exit(1); } always results in the error message. It seems that I can't specify a path along with the file name. I have no problems when I just use "helpfile" if ( (infile = fopen("helpfile", "r")) == NULL ) { fprintf(stderr, "Input file HELPFILE not found."); exit(1); } alone and execute the program in the same directory as the helpfile. Is there a way to specify the location of a file in some (other) directory? I'd like to be able to specify a file in a directory other than the current one. Also does anybody know a way of getting MS-DOS to use the return value of an exit(value) in a program? I.e. I'd like to know (at a DOS level) whether a program terminated with exit(0) or exit(1). thanks in advance for any info. esmail