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.
Created on 2009年12月23日 00:56 by jaraco, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue7566.diff | brian.curtin, 2010年07月23日 19:50 | |||
| Messages (5) | |||
|---|---|---|---|
| msg96822 - (view) | Author: Jason R. Coombs (jaraco) * (Python committer) | Date: 2009年12月23日 00:56 | |
In issue1578269, asvetlov suggests adding an implementation of os.sameopenfile to ntpath.py: --- Jason, as I see you implemented os.samefile (actually ntpath.samefile) but os.sameopenfile is still not implemented. Looks like it's easy to do: while GetFinalPathNameByHandle already accept file handle you can use CRT function _get_osfhandle(fd) to convert file descriptors (arguments for sameopenfile) to file handles and pass it to GetFinalPathNameByHandle. For me samefile and sameopenfile has very close semantic and I like to see both if it's possible. --- This seems entirely reasonable, but I would like to track and tackle this as a separate issue. |
|||
| msg96828 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2009年12月23日 02:07 | |
As NTFS supports hard links, I think GetFileInformationByHandle should be used to compare handles (looking at dwVolumeSerialNumber, nFileIndexHigh,nFileIndexLow) |
|||
| msg96841 - (view) | Author: Jason R. Coombs (jaraco) * (Python committer) | Date: 2009年12月23日 15:54 | |
That's an excellent idea. I had searched briefly for a more correct solution, but did not find one at the time. |
|||
| msg111377 - (view) | Author: Brian Curtin (brian.curtin) * (Python committer) | Date: 2010年07月23日 19:50 | |
Here's a patch implementing ntpath.sameopenfile with _getfileinformation in Modules/posixmodule.c. Martin's suggestion is the best way of doing this, which was the basis for _getfileinformation implementation. It returns a tuple of the three relevant fields, and ntpath.sameopenfile compares the results of those tuples for two files and returns the result. |
|||
| msg115717 - (view) | Author: Brian Curtin (brian.curtin) * (Python committer) | Date: 2010年09月06日 17:08 | |
Added in r84561. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:55 | admin | set | github: 51815 |
| 2010年09月06日 17:08:09 | brian.curtin | set | status: open -> closed resolution: fixed messages: + msg115717 stage: needs patch -> resolved |
| 2010年07月23日 19:50:13 | brian.curtin | set | files:
+ issue7566.diff keywords: + patch messages: + msg111377 |
| 2010年07月23日 15:06:25 | brian.curtin | link | issue8879 dependencies |
| 2010年06月28日 00:14:06 | brian.curtin | set | assignee: brian.curtin nosy: + brian.curtin stage: needs patch |
| 2010年02月16日 18:02:15 | akrpic77 | set | nosy:
+ akrpic77 components: - Library (Lib) versions: - Python 2.7 |
| 2010年02月16日 03:55:42 | brian.curtin | set | components:
+ Library (Lib) versions: + Python 2.7 |
| 2009年12月29日 12:03:59 | asvetlov | set | nosy:
+ asvetlov |
| 2009年12月23日 16:23:08 | eric.smith | set | nosy:
+ eric.smith |
| 2009年12月23日 15:54:13 | jaraco | set | messages: + msg96841 |
| 2009年12月23日 02:07:04 | loewis | set | nosy:
+ loewis messages: + msg96828 |
| 2009年12月23日 00:56:46 | jaraco | create | |