SHARE
TWEET

Untitled

a guest Aug 11th, 2017 149 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function SaveToFile;
  2.   var
  3.   Cnt :integer ;
  4.   begin
  5.     Cnt:=0;
  6.     AssignFile(F, HeadInfo.FileName);
  7.     ReWrite(F, 1);
  8.     // Seek(F, WriteCnt);
  9.     try
  10.       SetLength(FileBuf, HeadInfo.FileLen);
  11.       While  WriteCnt < HeadInfo.FileLen do
  12.         begin
  13.           cnt:=ClientSocket1.Socket.ReceiveBuf(FileBuf[0], HeadInfo.FileLen);
  14.           if cnt = 0 then continue;
  15.           BlockWrite(F, FileBuf[0], Cnt);
  16.           WriteCnt:=WriteCnt+Cnt;
  17.         end;
  18.  
  19.    
  20.     finally
  21.       CloSeFile(F);
  22.       SetLength(FileBuf, 0);
  23.    
  24.      end;
  25.  
  26. end;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top