default.txt 704 B

123456789101112131415161718192021222324252627282930
  1. TList = Class(TObject)
  2. Private
  3. Some: String;
  4. Public
  5. Procedure Inside; // Suxx
  6. End;{TList}
  7. Procedure CopyFile(InFileName, var OutFileName: String);
  8. Const
  9. BufSize = 4096; (* Huh? *)
  10. Var
  11. InFile, OutFile: TStream;
  12. Buffer: Array[1..BufSize] Of Byte;
  13. ReadBufSize: Integer;
  14. Begin
  15. InFile := Nil;
  16. OutFile := Nil;
  17. Try
  18. InFile := TFileStream.Create(InFileName, fmOpenRead);
  19. OutFile := TFileStream.Create(OutFileName, fmCreate);
  20. Repeat
  21. ReadBufSize := InFile.Read(Buffer, BufSize);
  22. OutFile.Write(Buffer, ReadBufSize);
  23. Until ReadBufSize<>BufSize;
  24. Log('File ''' + InFileName + ''' copied'#13#10);
  25. Finally
  26. InFile.Free;
  27. OutFile.Free;
  28. End;{Try}
  29. End;{CopyFile}