On 07/09/2014 04:22 PM, MRAB wrote: > On 2014-07-09 23:50, Ethan Furman wrote: >> >> Okay, marry the two ideas together: >> >> scandir(path, info=None, onerror=None) >> """ >> Return a generator that returns one directory entry at a time in a DirEntry object > > Should that be "that yields one directory entry at a time"? Yes, thanks. >> info: None --> DirEntries will have whatever attributes the O/S provides >> 'type' --> DirEntries will already have at least the file/dir distinction >> 'stat' --> DirEntries will also already have stat information >> """ >> >> DirEntry.is_dir() >> Return True if this is a directory-type entry; may call os.lstat if the cache is empty. >> >> DirEntry.is_file() >> Return True if this is a file-type entry; may call os.lstat if the cache is empty. >> >> DirEntry.is_symlink() >> Return True if this is a symbolic link; may call os.lstat if the cache is empty. >> >> DirEntry.stat >> Return the stat info for this link; may call os.lstat if the cache is empty. > > Why is "is_dir", et al, functions, but "stat" not a function? Good point. Make stat a function as well. -- ~Ethan~
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