From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1JW2FS-0002Uf-0h for garchives@archives.gentoo.org; Mon, 03 Mar 2008 04:25:58 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6A69FE03CE; Mon, 3 Mar 2008 04:25:54 +0000 (UTC) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by pigeon.gentoo.org (Postfix) with ESMTP id 1FE0CE03D8 for ; Mon, 3 Mar 2008 04:25:54 +0000 (UTC) Received: by ug-out-1314.google.com with SMTP id j3so1544424ugf.49 for ; Sun, 02 Mar 2008 20:25:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type:content-transfer-encoding; bh=gjYvFF67HKGDgREbpOf/et8ZozVN7VPXrb52vgPITeI=; b=MBC7uIylLFhHUHpOFo33f/lJVd+k7A4aCQ1FNA3Wu1p3g9ktJ/Dva62S9g7Oz0aZW5Whdx0HO7tTClElUiZtcYbdKjTMdYu0/RnJLaUfOFWdoEh/Xl5vlPJcieShfbD04/J9bSi7WVOcxpEqRu3cnYOPdQ4BI5SsTIYlYlkdN3Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type:content-transfer-encoding; b=ZGf3HII5rnN1kU4DAHNzOVxdfkm13dpZtUC4AxsILV37golUhjSuPUp9QkyVLIiVQpCRvmKsr9fE/5ymhIoVTFad1kRuhoKGPXB6ODadFYD/lKa7aKbRrFIBBpKIHFmKfBaeatiWGU1XGpjIWfc8rk1GaugJMI+ZL27uNxj31qY= Received: by 10.67.121.2 with SMTP id y2mr4363055ugm.78.1204518353403; Sun, 02 Mar 2008 20:25:53 -0800 (PST) Received: from ilievnet.com ( [84.21.204.1]) by mx.google.com with ESMTPS id r38sm2161056ugc.55.2008.03.02.20.25.52 (version=SSLv3 cipher=OTHER); Sun, 02 Mar 2008 20:25:52 -0800 (PST) Date: Mon, 3 Mar 2008 06:25:51 +0200 From: Daniel Iliev To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Set a property on a file and have it remove when the file is modified? Message-ID: <20080303062551.28c2f6d7@ilievnet.com> In-Reply-To: <47C9891E.9010902@gmail.com> References: <47C94EB4.1060803@gmail.com> <50ba04d20803010838t55713774ge9ed320cfac5386e@mail.gmail.com> <47C9891E.9010902@gmail.com> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.5; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: cc76784c-f391-4c00-91c6-55ea35595fbb X-Archives-Hash: e1a1c41c7d6f4988acc179e7661b889c On Sat, 01 Mar 2008 17:49:34 +0100 Erik wrote: > Matthias Guede skrev: > > 2008/3/1, Erik : > > > >> Is it possible to set a property on a file and have it remove > >> automatically when the file is modified? > >> > >> Suppose that we have a style checker that checks a lot of source > >> code files. Once it examined a file and found it to be clean, it > >> should set a property on the file ("style-clean"). Whenever the > >> style checker is executed it skips files with this property. > >> Whenever the file is modified, the filesystem removes the property. > >> > >> Is this possible? Which filesystems does it work on? > >> > > > > One solution would be using 'make'. With rules like the following > > only modified files will > > be proceeded: > > > > timestamp: myFile > > doSomthingWidth myFile > > touch timestamp > > > > We have thought about that, but we would like to avoid having a > parallel file hierarchy of timestamp files for our source tree. > Therefore something like the archive attribute (suggested by Etanoi > Shrdlu) would be better. Actually, if there are no other concerns, you'd have to keep only one file for reference. Then you could compare the modification times of all other files with this reference file. #!/bin/bash # initial/full scan touch timestamp.chk find hierarchy | while read some_file do [[ stylecheck("$some_file") -eq 0 ]] || touch "$some.file" done #EOF After this every time you run stylecheck(), you'd have to check only the files having newer time stamp than the one of "timestamp.chk". #!/bin/bash # incremental scan find hierarchy -newer timestamp.chk > modified.list touch timestamp.chk while read some_file do [[ stylecheck("$some_file") -eq 0 ]] || touch "$some.file" done < modified.list unlink modified.list #EOF -- Best regards, Daniel -- gentoo-user@lists.gentoo.org mailing list