Sign in Join

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

Mailing lists / fpc-pascal / 2012-04

Re: Fileread function (leledumbo)

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Luis Fernando Del Aguila Mejía
Do you mean if FileRead executed when the file pointer is at the end of file, it would wrap around to the beginning?

Yes, it is possible?
Example, is it correct?:

  FileWrite(Arch,b,40); // Write 40 bytes
  FileRead(Arch,b,40); //Read 40 bytes

or, is this correct?:

  FileWrite(Arch,b,40); // Write 40 bytes
  Fileseek(Arch,0,fsFromBeginning)); //Move to begining
  FileRead(Arch,b,40); //Read 40 bytes

thanks, sorry for my bad english

Reply by email

Unknown author
to Luis Fernando Del Aguila Mejía
Luis Fernando Del Aguila Mejía wrote 9 lines
El 02/04/2012 05:00 a.m., escribió: > Do you mean if FileRead executed when the file pointer is at the end of > file, > it would wrap around to the beginning? Yes, it is possible? Example, is it correct?: FileWrite(Arch,b,40); // Write 40 bytes FileRead(Arch,b,40); //Read 40 bytes

This is not possible.

Show quoted text 6 lines
or, is this correct?: FileWrite(Arch,b,40); // Write 40 bytes Fileseek(Arch,0,fsFromBeginning)); //Move to begining FileRead(Arch,b,40); //Read 40 bytes

This is correct.

Michael.

Reply by email