From: ara.t.howard@... Date: 2006-09-06T02:58:32+09:00 Subject: Re: File.ctime for detecting directory modifications? On Sat, 2 Sep 2006, Eero Saynatkari wrote: > Hi! > > Can anyone tell me if Ruby's File.ctime can be reliably > used to detect if a directory's contents have changed? > > I do not need to know of changes to files, just adds and > deletes of files to/from the directory itself. > > I have tested this on FreeBSD and OpenBSD and both seem > to indicate my expected behaviour (although File.mtime > does not)--if anyone can try other platforms or knows > offhand, the information would be appreciated. Windows > is not a concern. > > In case you are curious, I intend to cache the files under > $PATH and only re-access them if a modification has been > detected. Alternative solutions to this are also welcome. this may interest you, we've used it in production for years: http://codeforpeople.com/lib/ruby/dirwatch/dirwatch-0.9.0/README i'm about to release a new version - fyi. -a -- what science finds to be nonexistent, we must accept as nonexistent; but what science merely does not find is a completely different matter... it is quite clear that there are many, many mysterious things. - h.h. the 14th dalai lama