[Fontconfig] Cache and FAT

Behdad Esfahbod behdad at behdad.org
Wed Dec 9 10:13:36 PST 2009


On 12/09/2009 04:57 AM, Mikhail Gusarov wrote:
>
> Twas brillig at 21:18:18 08.12.2009 UTC-05 when behdad at behdad.org did gyre and gimble:
>
>   >>  1) scan directory and subdirectories and use max(mtimes, ctimes) of
>   >>  all files as mtime of directory.
>
>   BE>  Would be a PITA.
>
>   >>  2) add "hash" field to directory cache which is hash of all
>   >>      subdirectories' hashes and directory contents.
>
>   BE>  Isn't option #1 superior to this?  And doesn't need a change to the
>   BE>  cache format.
>
> I've came up with the following scenario:
>
> dir/
>    foo.ttf (mtime=5,ctime=5)
>
> otherdir/
>    bar.ttf (mtime=4,ctime=4)
>
> mv otherdir/bar.ttf dir =>
>
> dir/
>    foo.ttf (mtime=5,ctime=5)
>    bar.ttf (mtime=4,ctime=4)
>
> First variant will fail to detect new font in dir/ in this case, as
> Windows does not change any timestamp on moved file.
>
> Also, it should be possible to reuse mtime field in cache file for a
> hash (32-bit one, as cryptographical sthrength is not necessary here).

Right.  Since we only compare mtime for equality, we can simply use it as the 
directory hash.

Thanks,
behdad


More information about the Fontconfig mailing list