View Issue Details

IDProjectCategoryView StatusLast Update
0035185FPCRTLpublic2019-07-18 21:25
ReporterEugene KryukovAssigned To 
Status confirmedResolutionopen 
PlatformAllOSAllOS Version
Product Version3.2.0Product Build 
Target VersionFixed in Version 
Summary0035185: Can't open file with path more that 255 chars
DescriptionRTL limits path length by 255, which isn't enough in some cases. The main limitation is comes from "filerecnamelength=255" limitation. 1024 could be quite enough at this moment.
TagsNo tags attached.
Fixed in Revision
Attached Files


has duplicate 0035292 confirmed System.Rewrite and System.Reset silently fail with filenames > MAX_PATH 


Thaddy de Koning

2019-03-04 10:29

reporter   ~0114619

Last edited: 2019-03-04 10:30

View 2 revisions

Can you provide an example?
Because you are possibly using a deprecated API and in {$H-} mode.
There are several ways that avoid this older (TP/DOS) limitation already in place.

A simple example with TFileStream from classes would show you the limitation is not there.....

Thaddy de Koning

2019-03-04 10:33

reporter   ~0114620

Deprecated, but not on all platforms, I guess. Still this is old school and has limitations. I do not think it is warranted to correct it.

Marco van de Voort

2019-03-04 10:53

manager   ~0114622

(Afaik they must be static because the std files are threadvars, and are thus simply "duplicated" which would corrupt dyn strings)

Eugene Kryukov

2019-03-04 15:01

reporter   ~0114637

O, thx for explanation. There are some legacy code in our project with AssignFile, Reset and BlockRead. We will switch to SysUtils's file operation then.

Thaddy de Koning

2019-03-04 15:03

reporter   ~0114638

This can not be solved for that reason: shortstring.
But it is hard to replicate and does not affect normal/usual file IO.
I would like to see a simple example.

Thaddy de Koning

2019-03-04 15:08

reporter   ~0114639

Last edited: 2019-03-04 15:10

View 2 revisions

Assign,(and of course Reset and Rewrite etc) work, I am not sure about AssignFile (which is usually nonsense and you should use simply Assign).

Marco van de Voort

2019-03-06 15:38

manager   ~0114684

Last edited: 2019-03-06 15:38

View 2 revisions

The problem is in the filedescriptor record. Streams would be ok.

Tomas Hajny

2019-04-03 22:47

manager   ~0115206

Well, let's say that streams may be OK under certain conditions. ;-) The main conditions are:

1) The underlying operating system and the respective filesystems allow such long paths at all (some of our supported target operating systems don't support them, or at least not without special tricks - e.g. DOS and OS/2).

2) Potential preconditions for using such long paths on the respective operating systems are followed - although MS Windows allows using long paths, the paths must be passed using a special format.

The reporter didn't mention his target, so it isn't clear whether these conditions have any impact for him, or not.

Tomas Hajny

2019-04-04 00:41

manager   ~0115213

See also the linked bug report 0035292 for more information.

Issue History

Date Modified Username Field Change
2019-03-04 09:19 Eugene Kryukov New Issue
2019-03-04 10:29 Thaddy de Koning Note Added: 0114619
2019-03-04 10:30 Thaddy de Koning Note Edited: 0114619 View Revisions
2019-03-04 10:33 Thaddy de Koning Note Added: 0114620
2019-03-04 10:53 Marco van de Voort Note Added: 0114622
2019-03-04 12:39 Marco van de Voort Severity minor => feature
2019-03-04 15:01 Eugene Kryukov Note Added: 0114637
2019-03-04 15:03 Thaddy de Koning Note Added: 0114638
2019-03-04 15:08 Thaddy de Koning Note Added: 0114639
2019-03-04 15:10 Thaddy de Koning Note Edited: 0114639 View Revisions
2019-03-06 15:38 Marco van de Voort Note Added: 0114684
2019-03-06 15:38 Marco van de Voort Note Edited: 0114684 View Revisions
2019-04-03 22:29 Tomas Hajny Relationship added has duplicate 0035292
2019-04-03 22:47 Tomas Hajny Note Added: 0115206
2019-04-04 00:41 Tomas Hajny Note Added: 0115213
2019-05-31 18:05 Marco van de Voort Assigned To => Marco van de Voort
2019-05-31 18:05 Marco van de Voort Status new => confirmed
2019-05-31 18:05 Marco van de Voort FPCTarget => -
2019-05-31 18:05 Marco van de Voort Assigned To Marco van de Voort =>