<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">The main issue is the lack of stat caching. That is why I wrote my own module around scandir which includes the DirEntry objects for each path so that the consumer can also do stuff
 with the cached stat info (like check if it is a file or directory). Often we won't need to call stat on the path at all, and if we do it will only be once.<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div class="BodyFragment"><font size="2">
<div class="PlainText">Brendan Moloney<br>
Research Associate<br>
Advanced Imaging Research Center<br>
Oregon Health Science University</div>
</font></div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF535284"><font size="2" color="#000000" face="Tahoma"><b>From:</b> Python-ideas [python-ideas-bounces+moloney=ohsu.edu@python.org] on behalf of Guido van Rossum [guido@python.org]<br>
<b>Sent:</b> Tuesday, January 05, 2016 12:21 PM<br>
<b>To:</b> Chris Barker - NOAA Federal<br>
<b>Cc:</b> Python-Ideas<br>
<b>Subject:</b> Re: [Python-ideas] find-like functionality in pathlib<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Tue, Jan 5, 2016 at 8:37 AM, Chris Barker - NOAA Federal
<span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<span class="">> Note that the PEP doesn't mention rglob() -- why do we even have it? It seems rglob(pat) is exactly the same as glob('**/' + path) (assuming os.sep is '/'). No TOOWTDI here?<br>
<br>
</span>Much as I believe in TOOWTDI, I like having rglob(). "**/" is the kind<br>
of magic a newbie ( like me :-) ) would have research and understand.<br>
</blockquote>
</div>
<br>
</div>
<div class="gmail_extra">Sure. It's too late to remove it anyway.<br>
<br>
</div>
<div class="gmail_extra">Is there anything actionable here besides fixing the PermissionError and the behavior under symlink loops? IMO if you want files only or directories only you can just add a filter using e.g. is_dir():<br>
<br>
</div>
<div class="gmail_extra">p = pathlib.Path.cwd()<br>
</div>
<div class="gmail_extra">real_dirs =  [p for p in p.rglob('*') if p.is_dir() and not p.is_symlink()]<br clear="all">
</div>
<div class="gmail_extra"><br>
-- <br>
<div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>