Subject: RE: bin/7662: crontab(1) does not always save changed crontab file
To: NetBSD GNATS submissions and followups <gnats-bugs@gnats.netbsd.org>
From: Greg A. Woods <woods@most.weird.com>
List: netbsd-bugs
Date: 05/31/1999 13:06:36
[ On Sunday, May 30, 1999 at 08:41:18 (+0200), Martin Husemann wrote: ]
> Subject: RE: bin/7662: crontab(1) does not always save changed crontab file
>
> Refining the granularity of FS timestamps would sure be a better idea (when
> we move to 2038 safe timestamps...)

Trying to refine the granularity of FS timestamps is a never-ending and
thankless job (at least until Moore's Law hits "The Wall"), i.e. it's
definitely *not* the most elegant solution.  In fact I've always
considered it to be the least elegant solution, especially in a portable
operating system.

My suggestion is guaranteed to always avoid the problem, regardless of
the granularity of timestamps.

The only other solution I've ever managed to come up with involves
adding another file operation (perhaps with fcntl() or similar) to ask
the kernel if the file has been written to since the last time a given
process accessed the file.  It seems much less elegant though and
requires additional user-land coding for every application needing such
knowledge.

The number of programs that try on their own to do this kind of
timestamp stepping is quite astounding and rather disturbing -- I've
occasionally found myself writing similar code and it always frustrated
me immensely because I know that the kernel knows when a file has been
written to.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>