Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!mips!cs.uoregon.edu!gla-aux.uucp!glenn From: glenn@gla-aux.uucp (Glenn Austin) Newsgroups: comp.sys.mac.programmer Subject: Re: Does file exist in THINK C... Message-ID: <0E010021.vtc3ue@gla-aux.uucp> Date: 28 May 91 01:49:29 GMT Reply-To: glenn%gla-aux.uucp@skinner.cs.uoregon.edu Organization: The Pit Lane Lines: 16 X-Mailer: uAccess - Mac Release: 1.0.4a In article <1991May20.190829.3885@cs.yale.edu>, tarr-michael@CS.YALE.EDU (Michael J. Tarr) writes: > In THINK C (4.0.5) I wish to be able to find out if a file already > exists. In DOS the easy thing to do is access(filename, 0), but I don't > know of a comparable unix or Mac function. Any clues? Call GetFInfo on the file, and check the error code. If it exists, then noErr is returned. =============================================================================== | Glenn L. Austin | "Turn too soon, run out of room. | | Macintosh Wizard and | Turn too late, much better fate." | | Auto Racing Driver | -- Jim Russell Racing School Instructors | |-----------------------------------------------------------------------------| | Usenet: glenn@gla-aux.uucp | CI$: 76354,1434 | | GENie: G.AUSTIN3 | AOnline: GAustin | ===============================================================================