Replace TextFile/AssignFile/WriteLn
PMeira opened this issue · 1 comments
This issue is a reminder that AssignFile (actually TextFile) has a hard limit on the filename/path.
- Our old issue: #64
- One of the various other reports in the wild: https://forum.lazarus.freepascal.org/index.php?topic=51167.0
Why open a new issue? While implementing #65, it came to my attention that to make that work, the file paths would be longer. As such, I left the default value of the new option AllowChangeDir
as true. In the future, I'd like to change that to false, but first we should handle the limitations.
Given that file streams are also better for using different encodings, removing the old legacy TextFile
s seem ideal.
Depending on when this is implemented, another option would be to write this reports using C++.
Done! There was an initial performance downgrade, but then I added a couple TBufferFileStreams
, and a TStringList
for reading the DoBusCoordsCmd
. Now it's slightly faster, and will be faster when the main redirect loop uses a TBufferFileStreams
or TStringList
too (that was already done in the master branch).