Erik Sandberg <sandb...@virtutech.com> added the comment:

An alternative solution which I would have considered, is to extend
stat/fstat on Windows to set st_dev and st_ino to sensible values (based
on dwVolumeSerialNumber and nFileIndexLow/High), and then use the POSIX
implementations of samefile/sameopenfile.

There may be one potential problem with this solution though: It would
require stat to perform a CreateFile in addition to GetFileAttributesEx,
and I don't know if there are situations where one is allowed to call
the latter but not the former on a file. There would be no such problems
with fstat, though.

In your patch, I think the dwShareMode parameter to CreateFile* should
be changed to FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE so
make the operation less intrusive.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to