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 1JVTeM-0006D6-4n for garchives@archives.gentoo.org; Sat, 01 Mar 2008 15:29:22 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 01DF7E03E1; Sat, 1 Mar 2008 15:29:13 +0000 (UTC) Received: from dcnode-01.unlimitedmail.net (unknown [212.145.239.58]) by pigeon.gentoo.org (Postfix) with ESMTP id 6B605E03E1 for ; Sat, 1 Mar 2008 15:29:12 +0000 (UTC) Received: from ppp.zz ([137.204.208.98]) (authenticated bits=0) by dcnode-01.unlimitedmail.net (8.14.2/8.14.0) with ESMTP id m21FT80F007061 for ; Sat, 1 Mar 2008 16:29:08 +0100 From: Etaoin Shrdlu 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? Date: Sat, 1 Mar 2008 16:40:19 +0100 User-Agent: KMail/1.9.7 References: <47C94EB4.1060803@gmail.com> In-Reply-To: <47C94EB4.1060803@gmail.com> 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="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803011640.20067.shrdlu@unlimitedmail.org> X-UnlimitedMail-MailScanner-From: shrdlu@unlimitedmail.org X-Spam-Status: No X-Archives-Salt: 9a9b6e56-685f-4199-99cc-1b32105d4e58 X-Archives-Hash: bf3fc4346e242b4b3f73d819fcaadbf6 On Saturday 1 March 2008, Erik wrote: > 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? This is just an idea, and take it for what it is. I seem to remember that on fat filesystems, files used to have the "archive" attribute (along with the "hidden", "system", "readonly" attributes), which (back in the DOS/Win9x days) was meant to inform backup programs that the file was to be archived. The way it worked was more or less like this: when a file was created or modified, the OS set the "archive" flag for the file. The backup program, after backing up the file, cleared the flag. *If* linux implementations of the fat filesystem handle the "archive" flag (ie, set it when a file is modified), it should be possible to exploit this feature to your advantage. Just have the syntax checker clear the flag for a file upon succesful check, and have it run only on files with the flag set. When an application modifies the file, the flag will automatically be set again for that file (if it wasn't already, of course). If the above is true, "mattrib" (from the mtools package) can be used to manipulate fat attributes for a file. -- gentoo-user@lists.gentoo.org mailing list