Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!ames!think!husc6!cmcl2!rutgers!seismo!mcvax!enea!tut!utacs!av From: av@utacs.UUCP Newsgroups: comp.lang.c Subject: Re: 2 questions (Turbo C) Message-ID: <498@utacs.UTA.FI> Date: Mon, 31-Aug-87 01:26:31 EDT Article-I.D.: utacs.498 Posted: Mon Aug 31 01:26:31 1987 Date-Received: Wed, 2-Sep-87 07:09:02 EDT References: <9034@brl-adm.ARPA> Reply-To: av@utacs.UUCP (Arto Viitanen) Organization: University of Tampere, Dept. of Computer Science, Finland Lines: 32 In article <9034@brl-adm.ARPA> bonak%cs.uiowa.edu@RELAY.CS.NET (Esmail Bonakdarian) writes: >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 I know, you are going to get hundreds of answers, but me too... In C, \ is an escape character, so \t means character and so on. So, use fopen("c:\\temp\\helpfile", "r")) I remember, that MSDOS can also handle paths with '/' character in open-command. (That is, when there is confusion between file name and option) --------- Arto Viitanen University Of Tampere, Department of Computer Science P.O.Box 607 SF-33101 TAMPERE FINLAND av@utacs.uta.fi