New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement os.path.samefile and os.path.sameopenfile on Windows #50235
Comments
It would be nice if samefile / sameopenfile was present on Windows. In one of my projects I have written a C implementation of samefile, My code relies on GetFileInformationByHandle, which is only available in Unfortunately I don't use Windows myself, but I have rdesktop access to |
At this point, 2.7/3.2 are the only targets for new features. |
Here is my experimental patch. |
An alternative solution which I would have considered, is to extend There may be one potential problem with this solution though: It would In your patch, I think the dwShareMode parameter to CreateFile* should |
Once I considered this approach, but problems was that
Probably you are right. I must admit I'm not familiar with this *shared* |
Ah, I see, then your approach makes sense. There's another part of your patch that I don't understand: +except ImportError: # not running on Windows - mock up something sensible In what situations will this happen, and are we guaranteed in those |
I'm not sure about this neither. So, XXX is in comment. ;-) On abspath() above, it also tries to import native method I was not sure what kind of alternative implementation is appropriate, |
Actually, that page only says that file identities may vary over time, This means that it's actually essential that you don't close the file |
Please note: patch for http://bugs.python.org/issue1578269 is already has Unfortunately solution will work only starting from Windows Vista and |
Both os.path.samefile and os.path.sameopenfile are now in py3k. # Implemented on |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: