[comp.sys.apple] Directory modification dates

jason@madnix.UUCP (Jason Blochowiak) (06/09/89)

In article <32248@apple.Apple.COM> dlyons@Apple.COM (David Lyons) writes:
> [...]  Another approach would be to do something similar
>to what the Font Manager does with FONT.LISTS--keep a pre-built list of
>the things & know when to rebuild it automatically, without opening any
>of the files (just check for changes in name or last-mod date for all the
>files in the directory).
	Is it safe &&/|| reasonable to check the modification date of the
parent directory (to find out if anything's changed)? It would seem that
this would be significantly quicker vs. file checking when there weren't
any changes (which it's assumed would be most of the time). I was thinking
about doing something like NCD for APW (NCD is one of Peter Norton's MS-DOS
utilities that lets you change the current directory using a text
representation of the directory tree on the disk - something like what
Copy ][+ shows), and it'd be horrendously inefficient to re-read the entire
disk's directories. So, "will it always be true" that checking a directory's
modification date against something stored will guarantee that none of the
children of that directory have been changed since the stored date?

> --Dave Lyons, Apple Computer, Inc.          |   DAL Systems


-- 
_______________________________________________________________________________

    jason@madnix.UUCP, methinks.     Formerly blochowi@garfield.cs.wisc.edu
			"It beats working" - Harrison Ford

dlyons@Apple.COM (David Lyons) (06/12/89)

In article <683@madnix.UUCP> jason@madnix.UUCP (Jason Blochowiak) writes:
>	Is it safe &&/|| reasonable to check the modification date of the
>parent directory (to find out if anything's changed)? It would seem that
>this would be significantly quicker vs. file checking when there weren't
>any changes (which it's assumed would be most of the time).
>[...]

No, it isn't safe under all conditions.  Although the ProDOS FST normally
propogates the mod-dates back up the tree all the way to the volume
directory under System Disk 5.0 (and up to the top subdirectory under
4.0, I *think*), ProDOS 8 (and ProDOS 16?) doesn't.

Note that the mod-dates show up in the result of GET_DIR_ENTRY, so it
isn't necessary to do a GET_FILE_INFO on each file.  This makes things
very reasonable if you need to see if a particular directory has
changed.  (If you need to do a whole disk, you still have a problem.)

>    jason@madnix.UUCP, methinks.     Formerly blochowi@garfield.cs.wisc.edu
>			"It beats working" - Harrison Ford

 --Dave Lyons, Apple Computer, Inc.          |   DAL Systems
   AppleLink--Apple Edition: DAVE.LYONS      |   P.O. Box 875
   AppleLink--Personal Edition: Dave Lyons   |   Cupertino, CA 95015-0875
   GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
   Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons

   My opinions are my own, not Apple's.

m.tiernan@pro-angmar.UUCP (Michael Tiernan) (06/14/89)

Network Comment: to #1289 by obsolete!dlyons%apple.com

Dave, in your message, you point out that the ProDOS FST propagates the
changed dates through the directory structure but ProDOS 8 doesn't.  I thought
(Note that I didn't say assume! :->) that it was the application's
responsibility to perform the propagation under ProDOS 8?  And as such, YES
chcking the root directory for a change in Mod date is legal but NO it's a
very foolish thing to assume that EVERYONE who has handled the ball won't drop
it.


<< MCT >>

BCS Apple/Boston Connection     [MCT] (617) 893-5681
GEnie                           M.Tiernan
AppleLinkPE                     M Tiernan
BCS Net                         Michael Tiernan
obsolete!pro-angmar!m.tiernan@bloom-beacon.mit.edu
obsolete!pro-angmar!m.tiernan@bu-it.bu.edu
pro-angmar!m.tiernan@obsolete.uucp
m.tiernan@pro-angmar.cts.com

dlyons@Apple.COM (David Lyons) (06/16/89)

In article <8906150640.AA06515@obsolete.UUCP> m.tiernan@pro-angmar.UUCP (Michael Tiernan) writes:
>Network Comment: to #1289 by obsolete!dlyons%apple.com
>
>Dave, in your message, you point out that the ProDOS FST propagates the
>changed dates through the directory structure but ProDOS 8 doesn't.  I thought
>(Note that I didn't say assume! :->) that it was the application's
>responsibility to perform the propagation under ProDOS 8?  And as such, YES
>chcking the root directory for a change in Mod date is legal but NO it's a
>very foolish thing to assume that EVERYONE who has handled the ball won't drop
>it.

Root directories don't even *have* mod-dates under ProDOS 8, unfortunately.
GET_FILE_INFO on a volume name always (as far as I've ever seen) returns
zero for the mod-date.

Right--many applications *don't* bother propogating mod-date changed back
up the directory tree.  (My own stuff doesn't even do it.)

 --Dave Lyons, Apple Computer, Inc.          |   DAL Systems
   AppleLink--Apple Edition: DAVE.LYONS      |   P.O. Box 875
   AppleLink--Personal Edition: Dave Lyons   |   Cupertino, CA 95015-0875
   GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
   Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons

   My opinions are my own, not Apple's.