home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!ira.uka.de!chx400!bernina!bernina!neeri
- From: neeri@iis.ethz.ch (Matthias Neeracher)
- Subject: Re: Is a resource fork already open?
- In-Reply-To: ldo@waikato.ac.nz's message of 8 Sep 92 15:35:20 +1200
- Message-ID: <NEERI.92Sep8130709@iis.ethz.ch>
- Sender: news@bernina.ethz.ch (USENET News System)
- Organization: Integrated Systems Laboratory, ETH, Zurich
- References: <39464@imag.imag.fr> <1992Sep8.153520.10687@waikato.ac.nz>
- Date: Tue, 8 Sep 1992 12:07:09 GMT
- Lines: 28
-
- In article <1992Sep8.153520.10687@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
- >In article <39464@imag.imag.fr>, cinquin@imag.fr ( Philippe Cinquin) writes:
- >> Sorry if this is a stupid question, but how do you know if the resource fork of
- >> a file is already open?
- >
- >If a file is already open by somebody else, you'll get an error if you try
- >opening it in a mode that's incompatible with the other person's open mode.
- >
- >But I suspect you're really asking what happens when you open a resource file
- >twice from the same application. The answer is, you will get the same file
- >refnum back the second time. So how do you tell that this is happened? It can
- >be done, without too much low-level messing about.
-
- >[Low level messing about deleted :-]
-
- Excuse me, but am I missing something obvious or is there a much simpler way to
- determine if the resource fork is already open?
-
- PBGetCatInfo returns a field called ioFlAttrib, and according to
- _Inside Macintosh:Files_, bit 2 of that field is set if the resource
- fork is open.
-
- Matthias
-
- -----
- Matthias Neeracher neeri@iis.ethz.ch
- "You must have picked up that copy of Scarlett instead of Inside Mac
- when you tried to find the right call..." -- Keith Rollin
-