Skip to content

Instantly share code, notes, and snippets.

@coderjo
Created December 5, 2011 06:53
Show Gist options
  • Save coderjo/1432614 to your computer and use it in GitHub Desktop.
Save coderjo/1432614 to your computer and use it in GitHub Desktop.
python win32 file api workarounds
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