How to convert long Win95 paths to 8.3 dos paths?
Brad Clements
bkc at murkworks.com
Fri May 7 20:44:29 EDT 1999
Tim Peters wrote in message <000501be9836$5aad10e0$979e2299 at tim>...
>[Michael Scharf]
>> I am looking for a function, that can convert
>> long NT or Win95 names to 8.3 dos names
>> (the same name that 'dir /x' would show).
>> I could not find anything relevant in the
>> with dejanews nor on the python pages...
>
>Heh. Heh heh. Here's an extract from
> http://www.zdjournals.com/ddj/9608/ddj9681.htm
>
>
> You might expect to find [an MS API] function that will perform
> the necessary conversions from a long filename to an alternate
> filename and back. Surprisingly, the Windows 95 API doesn't supply
> such a function.
>
Funny, one of my Delphi programs does this..
Given a long file name pointed to by ES:DI, point DS:SI to the address of
the result buffer, set CX=1, AX=0x7160 and call int 21.
If carry is not set on return, then the result buffer has the short name.
To go the other way (short to long), set CX=2
Uh... this is a 16-bit program, your mileage will vary.. ;-)
More information about the Python-list
mailing list