I am trying to return an error with text that I want and it does not appear to be working. Can I return text like below through InitError?
{========================================================================}
procedure TMainForm.ScSFTPServerMakeDirectory(Sender: TObject;
SFTPSessionInfo: TScSFTPSessionInfo; const Path: string;
var Error: TScSFTPError);
begin
// InfoMemo.Lines.Append(SFTPSessionInfo.Client.UserExtData);
if Pos('C',SFTPSessionInfo.Client.UserExtData) > 0 then
begin
ScSFTPServer.DefaultMakeDirectory(SFTPSessionInfo,Path,Error);
end
else
begin
InitError(Error, erPermissionDenied, '550 Can''t create directory. Permission denied');
end;
end;
{========================================================================}
InitError
Re: InitError
You can use the code you provided to solve your task.
Note that to run this code, you should add the ScSFTPConsts unit to the USES clause of your unit.
Note that to run this code, you should add the ScSFTPConsts unit to the USES clause of your unit.