[Patches] [ python-Patches-997726 ] dircache fix; raise like os.listdir, plus optimization

SourceForge.net noreply at sourceforge.net
Sat Aug 21 13:11:11 CEST 2004


Patches item #997726, was opened at 2004-07-26 00:21
Message generated for change (Comment added) made by jlgijsbers
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=997726&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Carl Henrik Holth Lunde (chlunde)
Assigned to: Nobody/Anonymous (nobody)
Summary: dircache fix; raise like os.listdir, plus optimization

Initial Comment:
I think it would be better if dircache.listdir acts
like os.listdir on missing 
directories; raise os.error

Additionally, I rewrote the logic so it's about 15%
faster.  If you remove 
the outer try-except-block which purges the cache for a
folder on a 
miss it's 30% faster. This makes if five times as fast
as os.listdir (with
my program).

Not sure if anybody cares about the speed, the thing I
was surprised
about was that dircache wasn't a drop-in replacement
for listdir.

----------------------------------------------------------------------

>Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-08-21 13:11

Message:
Logged In: YES 
user_id=469548

Could you take a look at the latest CVS revision? I think
rev 1.12 and patch #707167 already make dircache raise
os.error on missing directories. The optimization would be
interesting, but you should post a diff against latest CVS
(see http://python.org/dev/devfaq.html#how-to-make-a-patch)
instead of a replacement file.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=997726&group_id=5470


More information about the Patches mailing list