Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!efi!tim From: tim@efi.com (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Is this file open? Message-ID: <1990Aug23.154556.13011@efi.com> Date: 23 Aug 90 15:45:56 GMT References: <1628@uvm-gen.UUCP> Organization: Electronics For Imaging, Inc. Lines: 11 In article <1628@uvm-gen.UUCP> emerson@griffin.uvm.edu (Tree) writes: >Is there a way to tell if a file returned from SFGetFile is already open? Yes. The usual way assumes that all you care about is whether it's already open in your application; just walk your application's window list (presumably, you have some internal data structure for your window list, but if not, you can always walk the system window list starting at FrontWindow) and see if it's there. If you want to see if anyone has it open in any way at all, call PBGetFInfo or PBHGetFInfo on it and see if the ioRefNum field is positive; if so, it's the refNum that the file is open under.