home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!agate!apple!apple!mumbo.apple.com!gallant.apple.com!dolson.apple.com!user
- From: d.olson@apple.com (Donald Olson)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: File ID questions!
- Message-ID: <d.olson-201192203254@dolson.apple.com>
- Date: 21 Nov 92 04:40:16 GMT
- References: <20NOV92.22500823.0068@VM1.MCGILL.CA>
- Sender: news@gallant.apple.com
- Followup-To: comp.sys.mac.programmer
- Organization: Apple Computer Inc.
- Lines: 42
-
- In article <20NOV92.22500823.0068@VM1.MCGILL.CA>, news@sifon.cc.mcgill.ca
- wrote:
- >
- >
- > Hi, all!
- >
- > I'm writing an INIT/CDEV that is supposed to watch user-specified
- > folders for activity (new files, removing files, etc) and take follow-
- > up action. I'm trying to code an efficient way of "snapshot"ing the
- > folder at regular intervals to detect adn pinpoint file movement.
- >
- > a) would it be healthy to just maintain a list of file IDs for
- > all files within a folder? How would this work for sub-folders? (Since
- > one cannot create a file ID for them) IM VI says that the
- > PBCreateFileIDRef function "creates a record to hold the file vRefNum
- > and directory ID). If I demand large volumes of FileIDs from the system,
- > will I be filling up disk directory space? Where is this information
- > stored and how efficiently?
- >
- > b) Is there an easier, more kocher way of keeping track of the
- > coming and going of files in specific folders? Any help is appreciated.
- >
- > CXEO@musica.mcgill.ca
-
- I'm not sure if this is what you asked, but...
-
- The way I'd go about it is to catalogue folder in question as you suggested
- and then track the modDate of the folder. Any modifications will cause the
- mod date of the folder to change and then you can iterate through to see
- what changed.
-
- You'll need to track the mod date of the files inside the folders in your
- 'catalogue' for the case where a user replaces a file with one of the same
- name. I think you could also check to see if the file id has been created
- for a file. If you've created a fileID for a file and the file gets
- replaced, the new file will not have a fileID associated with it.
-
- Of course, fileIDs only work on Sys 7 >
-
- Donald
-
-
-