procedure CopyFile( Source, Dest : string ); var SrcFile : Integer; DestFile : Integer; S : string; RetCode : Longint; OpenFileBuf : TOFStruct; FName : array[ 0..255 ] of Char; begin StrPCopy( FName, Source ); SrcFile := LZOpenFile( FName, OpenFileBuf, of_Read ); StrPCopy( FName, Dest ); DestFile := LZOpenFile( FName, OpenFileBuf, of_Create ); RetCode := LZCopy( SrcFile, DestFile ); if RetCode >= 0 then begin LZClose( SrcFile ); LZClose( DestFile ); end else begin Str( RetCode, S ); MessageDlg( 'Не могу скопировать ' + Source + ' в ' + Dest + #13 + 'Код ошибки = ' + S, mtError, [mbOk], 0 ); end; end; |
[000351]