A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-May/126164.html below:

[Python-Dev] Issue 11406: adding os.scandir(), a directory iterator returning stat-like info

[Python-Dev] Issue 11406: adding os.scandir(), a directory iterator returning stat-like infoVictor Stinner victor.stinner at gmail.com
Mon May 13 02:11:28 CEST 2013
2013/5/13 Ben Hoyt <benhoyt at gmail.com>:
> class DirEntry:
>     def __init__(self, name, dirent, lstat, path='.'):
>         # User shouldn't need to call this, but called internally by scandir()
>         self.name = name
>         self.dirent = dirent
>         self._lstat = lstat  # non-public attributes
>         self._path = path
>
>     def lstat(self):
>         if self._lstat is None:
>             self._lstat = os.lstat(os.path.join(self._path, self.name))
>         return self._lstat
> ...

You need to provide a way to invalidate the stat cache,
DirEntry.clearcache() for example.

Victor
More information about the Python-Dev mailing list

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