On 14 Feb 2015 13:17, "Cameron Simpson" <cs@zip.com.au> wrote:
> -1 on that. People will use it! Given the doco above, it should be obvious under what circumstances one might choose to call stat, and making that stat overt means it is less likely to be called unwisely.
> Since scandir is all about efficiency, providing a very costly convenience function seems to go against the grain.
> Regarding usefulness: Victor, you've got the typical use case in another post (i.e. useful as in "advantageous"), and your own tests show that st_dev of the dir matches st_dev of a dir's entries in all normal/regular filesystems (i.e.  useful as in "meaningful/consistent").  Special filesystems like /dev may be weird, but people relying on this should be aware of the constraint anyway.  Since a directory at the low level is essentially a mapping of names to inodes within the directory's filesystem, this is to be expected.

+1 from me for Cameron's perspective & rationale - it's useful for detecting hardlinks, it will usually work, and the cases where it isn't sufficient on its own are filesystem handling edge cases in more ways than one.


> Cheers,
> Cameron Simpson <cs@zip.com.au>
> Uh, this is only temporary...unless it works.   - Red Green
> _______________________________________________
> Python-Dev mailing list
> Python-Dev@python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com