[Lazarus] Deleteing a file that has a path that's longer than 256 characters

Richard Mace richard.mace at gmail.com
Tue Nov 26 16:31:30 CET 2013

Many thanks for this input Frederic, I'll check it out.


On 26 November 2013 14:16, Frederic Da Vitoria <davitofrg at gmail.com> wrote:

> 2013/11/26 Richard Mace <richard.mace at gmail.com>
>> Hi All,
>> I have an issue where I am unable to delete a file where the path name is
>> longer than 256 characters.
>> Interesting enough, the error as reported from Windows
>> (SysErrorMessage(GetLastError)) reports that Windows is unable to find the
>> path specified.
>> I have even tried renaming the file so that it is shorter (within the
>> full path) but I am unable to do that as Windows complains of the same
>> error message.
>> It lookis like it is a temeporay internet file that explorer has created
>> (if that helps)
>> Any ideas?
>> Lazarus 1.2 RC1 Windows Server 2003
> This is a pretty frequent Windows issue. IIRC, you have several options:
> 1: try to delete the file in a DOS shell using short names (for example
> replacing "My Documents" with "mydocu~1"). This is the best option as it
> avoids changing anything in your system. But it may not work because even
> the shortened path may be too long.
> 2+: see all the options form http://support.microsoft.com/kb/320081 , but
> I'd use solution 3 before solution 2 if the directory where your file is
> stored is installed by some software (as is suggested by your mention of
> "temporary internet file". If you have to use solution 2, then be careful
> to restore the original directory names before running any software which
> might use this directory.
> --
> Frederic Da Vitoria
> (davitof)
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20131126/8315cc77/attachment-0003.html>

More information about the Lazarus mailing list