Hello,
I was wondering is there a way to get the size of a file stream without the method .size of TFileStream ?
My concern about this method is how the size of the filestream will be calculated.
While (true) do
begin
if (FileStream.Size > 0) then
begin
//Do something with the File Stream
end
else
begin
// do something else
end;
end;
When i use strace i can see the following syscall made :
lseek(7, 0, SEEK_CUR) = 0
lseek(7, 0, SEEK_END) = 0
lseek(7, 0, SEEK_SET) = 0
I find it a bit heavy and too many syscalls are made (5 min of program running -> 100k+ lseek)
Does anyone faced the same issue ? Did i misuse the TFileStream class ?
PS : Should i get the size of the file through stat or another syscall ?
Thank you!
Valerife