Created
December 5, 2011 06:53
-
-
Save coderjo/1432614 to your computer and use it in GitHub Desktop.
python win32 file api workarounds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stathax(path): | |
if "Windows" == platform.system(): | |
return os.stat(u'\\\\?\\%s' % path) | |
else: | |
return os.stat(path) | |
def openhax(path, mode): | |
if "Windows" == platform.system(): | |
return open(u'\\\\?\\%s' % path, mode) | |
else: | |
return open(path, mode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment