Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!bionet!agate!helios.ee.lbl.gov!pasteur!cory.Berkeley.EDU!mcelhoe From: mcelhoe@cory.Berkeley.EDU (Glenn McElhoe) Newsgroups: comp.sys.mac.programmer Subject: Re: Keeping track of files Message-ID: <17768@pasteur.Berkeley.EDU> Date: 28 Sep 89 16:02:23 GMT References: <5875@viscous.sco.COM> Sender: news@pasteur.Berkeley.EDU Reply-To: mcelhoe@cory.Berkeley.EDU.UUCP (Glenn McElhoe) Organization: University of California, Berkeley Lines: 23 In article <5875@viscous.sco.COM> jamesm@sco.COM (James M. Moore) writes: > >I'm writing an application where I'd like to keep track of file locations >after a reboot. I assume that keeping track of the volume reference >number returned from SFGetFile isn't enough, as it's subject to change >across reboots. What should I use in addition to the file name? The 'vrefnum' that you get from SFGetFile is actually (under HFS) a working directory reference number, and will change when the working directory is closed (e.g. when you turn your machine off). Anyway, what you need to save are the real volume reference number, the DirID, and the name of the file. Of course this will all change under System 7.0, but then it will be more 'convenient' because you will only have three formats to be compatible with :-) The way to get these little gems is to use PBOpenWD to get the WD from the volume and dirID, and PBGetWDInfo to go the other way. Hope that helps, -- Glenn McElhoe (mcelhoe@cory.Berkeley.EDU)