Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SaveToFile;
- var
- Cnt :integer ;
- begin
- Cnt:=0;
- AssignFile(F, HeadInfo.FileName);
- ReWrite(F, 1);
- // Seek(F, WriteCnt);
- try
- SetLength(FileBuf, HeadInfo.FileLen);
- While WriteCnt < HeadInfo.FileLen do
- begin
- cnt:=ClientSocket1.Socket.ReceiveBuf(FileBuf[0], HeadInfo.FileLen);
- if cnt = 0 then continue;
- BlockWrite(F, FileBuf[0], Cnt);
- WriteCnt:=WriteCnt+Cnt;
- end;
- finally
- CloSeFile(F);
- SetLength(FileBuf, 0);
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement