On Mon, Jun 30, 2014 at 3:07 PM, Tim Delaney <timothy.c.delaney at gmail.com> wrote: > On 1 July 2014 03:05, Ben Hoyt <benhoyt at gmail.com> wrote: >> >> > So, here's my alternative proposal: add an "ensure_lstat" flag to >> > scandir() itself, and don't have *any* methods on DirEntry, only >> > attributes. >> ... >> >> > Most importantly, *regardless of platform*, the cached stat result (if >> > not None) would reflect the state of the entry at the time the >> > directory was scanned, rather than at some arbitrary later point in >> > time when lstat() was first called on the DirEntry object. > > > I'm torn between whether I'd prefer the stat fields to be populated on > Windows if ensure_lstat=False or not. There are good arguments each way, but > overall I'm inclining towards having it consistent with POSIX - don't > populate them unless ensure_lstat=True. > > +0 for stat fields to be None on all platforms unless ensure_lstat=True. This won't work well if lstat info is only needed for some entries. Is that a common use-case? It was mentioned earlier in the thread. -- Devin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4