Michael Droettboom <[EMAIL PROTECTED]> writes:

> One possible solution is to calculate a hash of the file and key off
> of that (with an I/O penalty, of course). I vaguely recall that keying
> off of the Postscript name embedded in the file wasn't good enough.

How about checking first the size of the file, assuming that
os.stat('filename').st_size is sensible on Windows? If the size matches
an existing file, compute a hash of the contents of both to see if they
are the same, and in any case, memoize the results so that future checks
of the exact same filename are fast. That way you only incur the cost of
the hash if the same file is included with multiple names, or in the
rare case that two different files have the same size.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to