home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sun-barr!olivea!spool.mu.edu!nigel.msen.com!yale.edu!jvnc.net!darwin.sura.net!haven.umd.edu!ni.umd.edu!zben-mac-ii.umd.edu!user
- From: zben@ni.umd.edu (Charles B. Cranston)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Is a resource fork already open?
- Message-ID: <zben-080992192800@zben-mac-ii.umd.edu>
- Date: 8 Sep 92 23:32:07 GMT
- References: <39464@imag.imag.fr> <1992Sep8.153520.10687@waikato.ac.nz> <NEERI.92Sep8130709@iis.ethz.ch> <BuA4CH.9C4@taligent.com>
- Sender: usenet@ni.umd.edu (USENET News System)
- Followup-To: comp.sys.mac.programmer
- Organization: UM Home for the Terminally Analytical
- Lines: 23
- Nntp-Posting-Host: zben-mac-ii.umd.edu
-
- In article <BuA4CH.9C4@taligent.com>, keith@taligent.com (Keith Rollin)
- wrote:
-
- > Sometimes you want to know if the resource fork is open in _your_
- > application. Calling PBGetCatInfo will tell you if the file is open
- > within _any_ application. The method Lawrence posted is the proper method.
- >
- > (Another method, which is more fun but which is very likely to break at some
- > time in the future is to walk the resource chain, pull out refnums, call
- > GetFCBInfo on them, and see if the file you are interested in is returned.)
-
- Yeah, I missed the ioFlAttib too, since the doc on the field is so far
- away from the doc on the trap. I came up with the follwing:
-
- Do GetCatInfo, if ioFRefNum is zero then no access path onto either fork
- is open, so the resource fork is not open.
-
- Else use a series of indexed GetFCBInfo calls to look for one that
- matches ParID and NamePtr and has bit 1 set in ioFCBFlags which says
- it is a resource fork path. I think this is a slightly cleaner version
- of what Keith jokingly suggests...
-
- zben@ni.umd.edu -KA3ZDF
-