Pastebin

Paste #2468: pascal write

< previous paste - next paste>

Pasted by Anonymous Coward

Download View as text

  AssignFile(OutFile, 'w');
  Rewrite(OutFile, 1);
  try
    Form1.ProgressBar1.Position:=0;
    Form1.ProgressBar1.Max:=Round((DiskFree(0) - BufferSize * 2 ) / 1024 / 1024);
    i := 0;
    While ( (doWrite = True ) and (DiskFree(0) > BufferSize * 2) ) do
    Begin
      Inc(i);
      If doWrite Then
      Begin
        BlockWrite(OutFile, Buffer, BufferSize, tmp);
        BytesWritten:= BytesWritten + BufferSize;
        Elapsed := GetTickCount() - StartTime;
        Application.ProcessMessages;
      end
      else
      begin
        Log('Aborting!');
      end;
      Application.ProcessMessages;
    end;
  finally
    Close(OutFile);
  end;

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.