Bonjour,

si quelqu'un a un compte, ça serait bien qu'il poste ce qui suit dans la page "discussion" :
+++
Wrong test in last example of Generic files of any type (starting with "With larger files of many Gb, ...")

Hello,
The test
Code : Sélectionner tout - Visualiser dans une fenêtre à part
  while TotalBytesRead <= FileStream.Size do  // While the amount of data read is less than or equal to the size of the stream do
never terminates... Should be
Code : Sélectionner tout - Visualiser dans une fenêtre à part
  while TotalBytesRead < FileStream.Size do  // While the amount of data read is less than to the size of the stream do
because TotalBytesRead will never reach FileStream.Size : starting at 0, TotalBytesRead grows up to FileStream.Size -1 !

Tested with
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
    while TotalBytesRead < FileStream.Size do  // While the amount of data read is less than to the size of the stream do
    begin
      BytesRead := FileStream.Read(Buffer,sizeof(Buffer));  // Read in 4096 of data
      inc(TotalBytesRead, BytesRead);                       // Increase TotalBytesRead by the size of the buffer, i.e. 4096 bytes
      // Do something with Buffer data
    end;
  finally
    FileStream.Free
  end;
  ShowMessage(IntToStr(TotalBytesRead)); // Shows the same value as FileSize
end;
+++
Merci et bon week-end,