Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-11

System.FileSize documentation

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

"Filesize returns the total number of records in file F. It cannot be invoked with a file of type Text. (under linux and unix, this also means that it cannot be invoked on pipes). If F is empty, 0 is returned."

It also returns zero if the file is untyped, i.e. hasn't been declared with "of byte" etc.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]
Tomas Hajny
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 6 lines
"Filesize returns the total number of records in file F. It cannot be invoked with a file of type Text. (under linux and unix, this also means that it cannot be invoked on pipes). If F is empty, 0 is returned." It also returns zero if the file is untyped, i.e. hasn't been declared with "of byte" etc.

True. Maybe better posted to the bug repository for category Documentation in order to avoid it being forgotten?

Tomas

Mark Morgan Lloyd
to Tomas Hajny: True. Maybe better posted to the bug repository for category Documentation in order to…
Tomas Hajny wrote 10 lines
On Wed, November 6, 2013 10:35, Mark Morgan Lloyd wrote: > "Filesize returns the total number of records in file F. It cannot be > invoked with a file of type Text. (under linux and unix, this also means > that it cannot be invoked on pipes). If F is empty, 0 is returned." > > It also returns zero if the file is untyped, i.e. hasn't been declared > with "of byte" etc. True. Maybe better posted to the bug repository for category Documentation in order to avoid it being forgotten?

http://bugs.freepascal.org/view.php?id=25288

Just wanted a second opinion :-)

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]
Tomas Hajny
to Marco van de Voort: In our previous episode, Mark Morgan Lloyd said: Isn't that incompatible? It should…
Marco van de Voort wrote 8 lines
In our previous episode, Mark Morgan Lloyd said: > It also returns zero if the file is untyped, i.e. hasn't been declared > with "of byte" etc. Isn't that incompatible? It should return in units defined by the 2nd param of the reset() command (which can be considered a defaultparameter with value 128 if not specified)

Oops, sorry - it should and indeed does so (I forgot about this default parameter at first while testing the current behaviour of FPC and its compatibility to TP/BP after seeing Mark's post and I suspect that the same might have happened to Mark). :-( In this context, the error report is probably not appropriate/necessary. Sorry to Mark for misleading him. :-(

Tomas