From: Garance A Drosehn Date: 2006-09-03T10:19:12+09:00 Subject: Re: File.ctime for detecting directory modifications? On 9/2/06, Paul Lutus wrote: > Rick DeNatale wrote: > > / ... > > > Actually, won't this behavior depend on the file system rather than the > > kernel? > > > > I don't know about ctime, but some filesystems allow control over > > whether other attributed like atime are maintained or updated. > > Good question, to which I don't have a general answer. I assumed that the > handling of file times were rather central to the identity of an operating > system (rather than a filesystem). It's just an assumption. The operating system just reports what the filesystem tells it. Consider the example where you have a distributed file system. The computer which is doing the Stat call may not be the same computer which added some file to the directory. It is only the information stored in the filesystem itself which can be seen on both systems. I expect your trick would work in very many situations, but there are some uncommon situations where the trick might not work. This is particularly likely if dealing with distributed filesystems like NFS or AFS, or if the path you are checking is in some kind of "union" filesystem. The trick might even work in those situations, but I can also imagine that it might not. -- Garance Alistair Drosehn = drosihn@gmail.com Senior Systems Programmer Rensselaer Polytechnic Institute; Troy, NY; USA