home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18744 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  2.2 KB

  1. 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
  2. From: d.olson@apple.com (Donald Olson)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: File ID questions!
  5. Message-ID: <d.olson-201192203254@dolson.apple.com>
  6. Date: 21 Nov 92 04:40:16 GMT
  7. References: <20NOV92.22500823.0068@VM1.MCGILL.CA>
  8. Sender: news@gallant.apple.com
  9. Followup-To: comp.sys.mac.programmer
  10. Organization: Apple Computer Inc.
  11. Lines: 42
  12.  
  13. In article <20NOV92.22500823.0068@VM1.MCGILL.CA>, news@sifon.cc.mcgill.ca
  14. wrote:
  15. >     Hi, all!
  16. >     I'm writing an INIT/CDEV that is supposed to watch user-specified
  17. > folders for activity (new files, removing files, etc) and take follow-
  18. > up action. I'm trying  to code an efficient way of "snapshot"ing the
  19. > folder at regular intervals to detect adn pinpoint file movement.
  20. >     a) would it be healthy to just maintain a list of file IDs for
  21. > all files within a folder? How would this work for sub-folders? (Since
  22. > one cannot create a file ID for them) IM VI says that the
  23. > PBCreateFileIDRef function "creates a record to hold the file vRefNum
  24. > and directory ID). If I demand large volumes of FileIDs from the system,
  25. > will I be filling up disk directory space? Where is this information
  26. > stored and how efficiently?
  27. >     b) Is there an easier, more kocher way of keeping track of the
  28. > coming and going of files in specific folders? Any help is appreciated.
  29. > CXEO@musica.mcgill.ca
  30.  
  31. I'm not sure if this is what you asked, but...
  32.  
  33. The way I'd go about it is to catalogue folder in question as you suggested
  34. and then track the modDate of the folder. Any modifications will cause the
  35. mod date of the folder to change and then you can iterate through to see
  36. what changed.
  37.  
  38. You'll need to track the mod date of the files inside the folders in your
  39. 'catalogue' for the case where a user replaces a file with one of the same
  40. name. I think you could also check to see if the file id has been created
  41. for a file. If you've created a fileID for a file and the file gets
  42. replaced, the new file will not have a fileID associated with it. 
  43.  
  44. Of course, fileIDs only work on Sys 7 >
  45.  
  46. Donald
  47.  
  48.  
  49.