I need to convert paths in 8.3 convention to full path.
In Perl, I can use Win32::GetLongPathName() as pointed out in How do I get full Win32 path from 8.3 DOS path with Perl? But, I need to do it in Python.
views:
133answers:
3
+1
A:
Use ctypes. Like this:
from ctypes import *
buf = create_unicode_buffer(260)
GetLongPathName = windll.kernel32.GetLongPathNameW
rv = GetLongPathName(path, buf, 260)
print buf.value
From http://mail.python.org/pipermail/python-win32/2008-January/006642.html
jonasl
2009-10-19 10:19:42
It doesn't work.. I tried for path "C:\\progra~1".Empty string returned.
Nelly
2009-10-19 10:34:50
I say even more. It returns empty string for long path "C:\\Program Files" too
Nelly
2009-10-19 10:35:43