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.
-- 
[email protected] mailing list

Reply via email to