[fpc-pascal] ExpandFileName failure on long filenames on Linux

Tomas Hajny XHajT03 at hajny.biz
Sat Aug 31 17:48:33 CEST 2013

On Sat, August 31, 2013 16:55, Bart wrote:
> On 8/31/13, Tomas Hajny <XHajT03 at hajny.biz> wrote:
>> Now, as you have already found out yourself too, it is not an issue with
>> ExpandFileName only, but also with the overloaded version of GetDir
>> returning ansistring but still limited to 255 characters. I could
>> provide
>> a workaround for ExpandFileName (using SysUtils.GetCurrentDir and
>> basically replicating the implementation of System.GetDir under Windows
>> except for using ansistrings), but fixing the ansistring overloaded
>> version of System.GetDir sound as a more appropriate option to me.
> I was unable to test under Windows, but because the offending code is
> in a generic inc file, I suspect it happens on Windows as well.
> On Linux I saw several file related functions that seem to handle only
> shortstrings...
> Should I file a bugreport?

In general, it is a known fact that file system related functions provided
by unit System are limited to shortstrings. From this point of view,
GetDir is rather an exception (and admittedly rather unfortunate one
considering the current state of implementation), because it provides an
overloaded ansistring version. From this point of view, I would say that a
bug report is indeed appropriate, but I'd limit it to GetDir for now (for
the others like MkDir, etc., you could file a feature request at best).


More information about the fpc-pascal mailing list