Path: utzoo!attcan!uunet!snorkelwacker!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: how to compare file modification time in bourne shell script Message-ID: <25842@mimsy.umd.edu> Date: 2 Aug 90 10:08:53 GMT References: <1990Jul23.233044.2729@silma.com> <8855@jpl-devvax.JPL.NASA.GOV> <324@sun13.scri.fsu.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 37 In article <324@sun13.scri.fsu.edu> mayne@VSSERV.SCRI.FSU.EDU (William (Bill) Mayne) writes: >Others have suggested the use of make to [compare file modtimes].... >Just in case my main question gets hidden in the fog, I will restate >it: The timestamp of a symbolic link is the time when the link was >created, rather than the last modication of the file ultimately >referenced. Right. >Thus a make file which refers to a symbolic link is fooled. Wrong---or `should be wrong', at least. >Why was the system designed in a way that makes this use of make so >difficult? It was not. Although symbolic links do occupy an inode, and therefore have all the information a `stat' operation can find, they are not normally supposed to be examined by programs. Indeed, it requires a special system call (lstat()) to get this information: most system calls follow symlinks to their ultimate destinations. (The only other lookup operations that do not follow symlinks are chown(), probably because the space used for the target of the link is charged to the owner and thus this must be changeable, and readlink(), for the obvious reason. Removal operations, of course, do not follow symlinks. Normal creation operations do; opens for creating with O_EXCL do not.) Only a few programs---e.g., find (which must not follow symlinks since they may not form a tree) and ls (which should show the name and target, or whatnot)---have any business using lstat(). `Make' is not such a program. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris