Recent

Author Topic: Enhancement to TextRec and TFileRec when considering long file names  (Read 732 times)

jamie

  • Hero Member
  • *****
  • Posts: 7707
I still think the Old Pascal file system hasn't died and should be brought up to the present without a lot of issues.

We have Managed Records now for some time and It would be a good idea for the AssignFile to instead of using a fixed array internally which is 255 bytes, Delphi is 260; that maybe a PWideChar pointer can be placed there instead when the platform supports it.

 A Finalize operator can be used to free and nil it.

 a Initialize operator of course can be used to zero it out.

 This way file names can exceed the limit and things will still look native. I know you can use the Managed string but, the {$H+} isn't always in program settings and it would need to be Widestring etc.

Jamie


   
The only true wisdom is knowing you know nothing

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12857
  • FPC developer.
Re: Enhancement to TextRec and TFileRec when considering long file names
« Reply #1 on: March 29, 2026, 05:09:12 pm »

jamie

  • Hero Member
  • *****
  • Posts: 7707
Re: Enhancement to TextRec and TFileRec when considering long file names
« Reply #2 on: March 29, 2026, 05:17:39 pm »
Ok, well that's nice it's in the trunk %)

However, I noticed there isn't any management operators in there, how is the pointer cleaned up before exit ?

Jamie


The only true wisdom is knowing you know nothing

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12857
  • FPC developer.
Re: Enhancement to TextRec and TFileRec when considering long file names
« Reply #3 on: March 29, 2026, 05:24:12 pm »
Ok, well that's nice it's in the trunk %)

However, I noticed there isn't any management operators in there, how is the pointer cleaned up before exit ?

Jamie

closefile?

jamie

  • Hero Member
  • *****
  • Posts: 7707
Re: Enhancement to TextRec and TFileRec when considering long file names
« Reply #4 on: March 29, 2026, 07:49:15 pm »
and if the file fails to open/create along with possible Exception handling how does this play out?

Normally if a file fails to open in some way there isn't any file to close?


I'll wait when the trunk gets its shackles off it to try it out.
Thx
Jamie
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018