Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 Unisoft-Cosmos; site micropro.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!well!micropro!edg From: edg@micropro.UUCP (Ed Greenberg) Newsgroups: net.micro.pc Subject: Re: Pathnames in "C" compilers (Help!) Message-ID: <160@micropro.UUCP> Date: Mon, 23-Sep-85 01:31:50 EDT Article-I.D.: micropro.160 Posted: Mon Sep 23 01:31:50 1985 Date-Received: Wed, 25-Sep-85 10:40:06 EDT References: <450@philabs.UUCP> Reply-To: edg@micropr.UUCP (Ed Greenberg) Distribution: net Organization: MicroPro Int'l Corp., San Rafael, CA Lines: 26 In article <450@philabs.UUCP> brb@philabs.UUCP (Brian Bertan) writes: >I am unable to open files using a directory search with either the >Mark Williams or Lattice "C" compilers. The file really does exist > ... > >The function: > > infile=fopen("c:\usr\text\things.txt","r") > >returns NULL to infile. > ... >Does anyone know why I can't properly use a pathname in fopen() ? > Brian Bertan Sounds to me that you need to double the backslashes in your pathname, a problem that Unix C programmers would never encounter. Try: infile=fopen("c:\\usr\\text\\things.txt","r") This is only required if the filename is created as a quoted string constant, as above. If, for example, the user typed the pathname in, I suspect that the double backslashes would not be necessary. -- -edg UUCP: {hplabs,dual,ptsfa}!well!micropro!edg