[fpc-pascal] Re: Unicodestrings and Assign(File)

Reinier Olislagers reinierolislagers at gmail.com
Sun May 13 06:52:46 CEST 2012

On 13-5-2012 5:59, dmitry boyarintsev wrote:
> I'm assuming that everyone is aware of the solution for this.
> Every unicode file name still has ANSI-dos name (aka ShortName).
> You could write a function that would return a short name based on
> unicode name of a file. And pass the short name to Assign File
> function.
> thanks,
> Dmitry

Hi Dmitry,

Do you mean the ShortName as the 8.3 name defined on this page:
... it states
"When you create a long file name, Windows may also create a short 8.3
form of the name, called the 8.3 alias, and store it on disk also."
So it isn't compulsory to store the 8.3 filename - which is confirmed
later on by:
"8.3 aliasing cannot be disabled for specified volumes until Windows 7
and Windows Server 2008 R2."... implying it can be disabled in Win7 and

Looking at the GetShortPathName function
... the text itself only says the function can fail - not when it is
likely to failx.
Comment below does shed more light:
"GetShortPathName fails to create a short filename if the file doesn't
have a short file name."..."You can turn this option off by using the
"System Policy Editor" (Poledit.exe). Certain file systems also don't
support creation of short names by default"

Or are you talking about a different way of getting a short name?


More information about the fpc-pascal mailing list