Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!mips!twg.com!lefty From: lefty@twg.com (David N. Schlesinger) Newsgroups: comp.sys.mac.programmer Subject: Re: A couple of questions Message-ID: <7496@gollum.twg.com> Date: 6 Jul 90 23:04:31 GMT Sender: news@twg.com Organization: The Wollongong Group Lines: 23 References:<26801@bcsaic.UUCP> <8799@goofy.Apple.COM> In article <8799@goofy.Apple.COM> stevec@Apple.COM (Steve Christensen) writes: > In article <26801@bcsaic.UUCP> lbaum@bcsaic.UUCP (Larry Baum) writes: > >How can I determine if the file is alreadfy open, before I call > >OpenResFile? > > Call GetFileInfo and see if bit 7 of the ioFlAttrib field is set. I can't > remember if it makes a distinction between the resource and data forks or > if that bit is set when either fork is open. Specifically, if the resource fork of the file is open, bit 2 of ioFlAttrib will be set; if the data fork is open, bit 3 will be set. If either fork is open, bit 7 of ioFlAttrib will be set and ioFRefNum will be non-zero. Lefty |<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| | David N. Schlesinger || "When I have nothing to say, | | The Wollongong Group || my lips are sealed; | | Internet: Lefty@twg.com || say something once, | | POTS: 415/962-7219 || why say it again?" -- David Byrne | |<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>|