How should one do this?
https://www.freepascal.org/docs-html/current/rtl/system/seekeof.html implies that it's only for text files, Seek(f, FileSize(f)) seems excessive.
Mailing lists / fpc-pascal / 2017-11
Seek to EOF of file of byte
5 messages · 3 people ·
- MMark Morgan Lloyd 3
- GGraeme Geldenhuys 1
- UUnknown author 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Mark Morgan Lloyd wroteHow should one do this? https://www.freepascal.org/docs-html/current/rtl/system/seekeof.html implies that it's only for text files, Seek(f, FileSize(f)) seems excessive.
Just curious, why would you consider the "old technology" instead of using TFileStream (or any of the other TStream descendants).
I'm actually busy converting some old apps that used "t: Text" style coding, and replacing it with more modern Stream-style code, and it works really well. Streams are so much more flexible.
Regards,
Graeme
Graeme Geldenhuys wrote 10 lines
With your propensity for "I wouldn't start from here" answers I'm surprised you're not on CIX :-)
Basically, because the program is being viewed critically by the ALGOL programmer whose code I'm converting, and a number of other people of a comparable generation and background. So while I'm using OO fairly heavily and threads where the architecture makes them appropriate ** I'm trying not to change stuff gratuitously.
** The original code tried to simulate up to 2x CPUs and up to 4x IOPs using a single thread. I'm trying to do it properly.
Mark Morgan Lloyd wrotebecause the program is being viewed critically by the ALGOL programmer whose code
Algol, one my all time favourite languages.
while .... wend
if .... fi
why is this not universally adopted?
I still comment my C code with fi's and wend's to keep track of what a bunch of curly braces actually refer to.
C : a high level language with power of assembler and the readability of .... assembler.
Python : a high level language with the readability of assembler and performance of MSBASIC.
;)
Show quoted text 7 lines
/Don't/ get me going, particularly here. Basically, because Wirth threw his toys out of the pram when ALGOL-W was rejected, and rushed out Pascal as an alternative without looking at the few bits of ALGOL-68 which were useful for something. He didn't come to his senses until Modula-2 or his involvement with Ada (I'm not sure which came first) but by then the damage was done.
