From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 18 15:59:20 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F09F016A4CE for ; Tue, 18 Nov 2003 15:59:20 -0800 (PST) Received: from cyclone.he.net (cyclone.he.net [64.62.230.2]) by mx1.FreeBSD.org (Postfix) with SMTP id 610EA43FDF for ; Tue, 18 Nov 2003 15:59:20 -0800 (PST) (envelope-from lists@battleface.com) Received: from battleface.com ([24.52.31.3]) by cyclone.he.net for ; Tue, 18 Nov 2003 15:59:18 -0800 Date: Tue, 18 Nov 2003 18:59:17 -0500 Mime-Version: 1.0 (Apple Message framework v552) Content-Type: text/plain; charset=US-ASCII; format=flowed From: lists@battleface.com To: freebsd-hackers@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <383537BA-1A23-11D8-B220-000A95775140@battleface.com> X-Mailer: Apple Mail (2.552) Subject: mtime and directories... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2003 23:59:21 -0000 Changing a file, of course, results in a change to its modification time. Am I correct in determining that the mtime of the enclosing directory is also updated? The reason I'm asking this is because I need to be able to determine if any file has changed within a directory from a shell script, Perl, or Python. All I need to know is if at least one file has changed. I don't need to find all such files. [Sidelight: anyone know how, if possible, to stop find after finding one file? I can't figure this one out alone.] My initial solution was to use 'find' to find any files newer than a marker file. However, I believe I've determined that the mtime of enclosing directories also changes to reflect the last file that was updated within its hierarchy. So, it makes sense that I simply check the directory that contains the marker file. Thanks, Alex