This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ocean-city
Recipients brian.curtin, giampaolo.rodola, ocean-city
Date 2010-09-23.22:02:24
SpamBayes Score 0.003680158
Marked as misclassified No
Message-id <1285279346.29.0.763938711941.issue8879@psf.upfronthosting.co.za>
In-reply-to
Content
With following implementation, issamefile return True
for hard link. I heard GetFinalPathNameByHandle
returns different paths for hard links.

>>> import nt, os
>>> def issamefile(path1, path2):
...     fd1 = os.open(path1, os.O_RDONLY)
...     fd2 = os.open(path2, os.O_RDONLY)
...     fi1 = nt._getfileinformation(fd1)
...     fi2 = nt._getfileinformation(fd2)
...     os.close(fd1)
...     os.close(fd2)
...     return fi1 == fi2
...
>>> issamefile("src.txt", "lnk.txt")
True
History
Date User Action Args
2010-09-23 22:02:26ocean-citysetrecipients: + ocean-city, giampaolo.rodola, brian.curtin
2010-09-23 22:02:26ocean-citysetmessageid: <1285279346.29.0.763938711941.issue8879@psf.upfronthosting.co.za>
2010-09-23 22:02:24ocean-citylinkissue8879 messages
2010-09-23 22:02:24ocean-citycreate