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

Frederic Da Vitoria davitofrg at gmail.com
Tue Nov 26 15:16:46 CET 2013

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

Membre de l'April - « promouvoir et défendre le logiciel libre » -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20131126/8c6e22ff/attachment-0003.html>

More information about the Lazarus mailing list