On Sun, May 12, 2013 at 1:42 AM, Christian Heimes <christ...@python.org> wrote: > I suggest that we call it .lstat() and .cached_lstat to make clear that > we are talking about no-follow stat() here.
Fair point. > On platforms that support > fstatat() it should use fstatat(dir_fd, name, &buf, AT_SYMLINK_NOFOLLOW) > where dir_fd is the fd from dirfd() of opendir()'s return value. It may actually make sense to expose the dir_fd as another attribute of the dir_entry object. >> If we find other details that we can reliably provide cross-platform >> from the dir information, then we can add more query methods orst >> attributes to the dir_entry object. > > I'd like to see d_type and d_ino, too. d_type should default to > DT_UNKNOWN, d_ino to None. I'd prefer to see a more minimal set to start with - just the features needed to implement os.walk and os.fwalk more efficiently, and provide ready access to the full stat result. Once that core functionality is in place, *then* start debating what other use cases to optimise based on which platforms would support those optimisations and which would require dropping back to the full stat implementation anyway. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com