Re: Suggestion for file type detection approach



Le mar 13/01/2004 à 20:00, Soeren Sandmann a écrit :

> The problem is that you need a correct answer to the question "did
> this file change since last time?". And there is no way to get that
> without reading the file, as far as I know.

Of course, that's not feasible. The only thing you can trust is the fs
metadata, i.e. the modification time. If a program messes with it,
tough, but you can't do anything.

> The canonical counter-example: someone turns every byte of a file into
> 'X' and resets the modification dates back to the original. Wihtout
> looking inside the file can you tell someone touched it?

Of course no (even famd/dnotify tricks won't always work).

> Maybe an approximation based on modification dates would be
> acceptable, given that sniffing itself is also just an approximation
> (Flames about filing bugs notwithstanding). As soon as nautilus
> actually _acts_ on the mime type instead of just displaying it, it
> could run the sniffer to minimize the damage done from having bad
> information in the cache. I don't know what would happen UI-wise when
> a mismatch was discovered, though.

... or just accept that mime-types can be wrong, and ask the user to
press "refresh" to sniff all files again (well, all files not under
famd's control since last sniffed). Anyway, if famd isn't running (and
some users don't like it) a folder view is out-of-date as soon as
displayed.

	Xav




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]