Skip to content

Commit

Permalink
Revert the old copy file function
Browse files Browse the repository at this point in the history
  • Loading branch information
r57zone committed Dec 30, 2020
1 parent 25c2767 commit a78d140
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Source/Unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ procedure StatusText(Str: string);
Main.StatusBar.SimpleText:=' ' + CutStr(Str, 80);
end;

function CPFile(const AFrom, ATo: string): boolean;
{function CPFile(const AFrom, ATo: string): boolean;
var
FromF, ToF: file;
NumRead, NumWritten, DataSize: integer;
Expand Down Expand Up @@ -138,7 +138,7 @@ function CPFile(const AFrom, ATo: string): boolean;
CloseFile(ToF);
if StopRequest then DeleteFile(ATo);
end;
end;
end;}

procedure CheckFilesDiff(LocalFolder, RemoteFolder: string);
var
Expand Down Expand Up @@ -354,15 +354,16 @@ procedure ActionsRun;
if Copy(Actions.Strings[i], 1, 5) = 'COPY ' then begin
Delete(ActionStr, 1, 5);
try
{StatusText(ID_COPY_FILE + ' ' + Copy(ActionStr, 1, Pos(#9, ActionStr) - 1));
{if CopyFile( PChar( Copy(ActionStr, 1, Pos(#9, ActionStr) - 1) ),
PChar( Copy(ActionStr, Pos(#9, ActionStr) + 1, Length(ActionStr)) ), false) then begin}
if CPFile( Copy(ActionStr, 1, Pos(#9, ActionStr) - 1),
Copy(ActionStr, Pos(#9, ActionStr) + 1, Length(ActionStr)) ) then begin
StatusText(ID_COPY_FILE + ' ' + Copy(ActionStr, 1, Pos(#9, ActionStr) - 1));
if CopyFile( PChar( Copy(ActionStr, 1, Pos(#9, ActionStr) - 1) ),
PChar( Copy(ActionStr, Pos(#9, ActionStr) + 1, Length(ActionStr)) ), false) then begin
{if CPFile( Copy(ActionStr, 1, Pos(#9, ActionStr) - 1),
Copy(ActionStr, Pos(#9, ActionStr) + 1, Length(ActionStr)) ) then begin}
Inc(GoodCopyFilesCounter);
Actions.Strings[i]:='';
end else
Inc(BadCopyFilesCounter);
Application.ProcessMessages;
except
Inc(BadCopyFilesCounter);
end;
Expand Down Expand Up @@ -909,8 +910,8 @@ procedure TMain.StopBtnClick(Sender: TObject);

procedure TMain.AboutBtnClick(Sender: TObject);
begin
Application.MessageBox(PChar(Caption + ' 0.8' + #13#10 +
ID_LAST_UPDATE + ' 15.12.2020' + #13#10 +
Application.MessageBox(PChar(Caption + ' 0.8.1' + #13#10 +
ID_LAST_UPDATE + ' 30.12.2020' + #13#10 +
'https://r57zone.github.io' + #13#10 +
'[email protected]'), PChar(ID_ABOUT_TITLE), MB_ICONINFORMATION);
end;
Expand Down

0 comments on commit a78d140

Please sign in to comment.