home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15135 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.8 KB  |  41 lines

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