>> The PEP says that DirEntry should mimic pathlib.Path, so I think that >> DirEntry.is_dir() should work as os.path.isir(): if the entry is a >> symbolic link, you should follow the symlink to get the status of the >> linked file with os.stat(). > > Would this not "break" the tree size script being discussed in the > other thread, as it would follow links and include linked directories > in the "size" of the tree? Yeah, I agree. Victor -- I don't think the DirEntry is_X() methods (or attributes) should mimic the link-following os.path.isdir() at all. You want the type of the entry, not the type of the source. Otherwise, as Paul says, you are essentially forced to follow links, and os.walk(followlinks=False), which is the default, can't do the right thing. -Ben
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