mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 01:29:29 +02:00
* improved prototypes for dos.
git-svn-id: trunk@33356 -
This commit is contained in:
parent
e7eb7d7415
commit
7cda2d237f
@ -797,7 +797,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString;Flags:TExecuteFlags=[]):integer;
|
||||
function ExecuteProcess(Const Path: RawByteString; Const ComLine: RawByteString;Flags:TExecuteFlags=[]):integer;
|
||||
var
|
||||
e : EOSError;
|
||||
CommandLine: AnsiString;
|
||||
@ -819,11 +819,50 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function ExecuteProcess (const Path: AnsiString;
|
||||
const ComLine: array of AnsiString;Flags:TExecuteFlags=[]): integer;
|
||||
function ExecuteProcess (const Path: RawByteString;
|
||||
const ComLine: array of RawByteString;Flags:TExecuteFlags=[]): integer;
|
||||
|
||||
var
|
||||
CommandLine: AnsiString;
|
||||
CommandLine: RawByteString;
|
||||
I: integer;
|
||||
|
||||
begin
|
||||
Commandline := '';
|
||||
for I := 0 to High (ComLine) do
|
||||
if Pos (' ', ComLine [I]) <> 0 then
|
||||
CommandLine := CommandLine + ' ' + '"' + ComLine [I] + '"'
|
||||
else
|
||||
CommandLine := CommandLine + ' ' + Comline [I];
|
||||
ExecuteProcess := ExecuteProcess (Path, CommandLine);
|
||||
end;
|
||||
|
||||
function ExecuteProcess(Const Path: unicodeString; Const ComLine: unicodeString;Flags:TExecuteFlags=[]):integer;
|
||||
var
|
||||
e : EOSError;
|
||||
CommandLine: UnicodeString;
|
||||
|
||||
begin
|
||||
dos.exec_ansistring(path,comline);
|
||||
|
||||
if (Dos.DosError <> 0) then
|
||||
begin
|
||||
if ComLine <> '' then
|
||||
CommandLine := Path + ' ' + ComLine
|
||||
else
|
||||
CommandLine := Path;
|
||||
e:=EOSError.CreateFmt(SExecuteProcessFailed,[CommandLine,Dos.DosError]);
|
||||
e.ErrorCode:=Dos.DosError;
|
||||
raise e;
|
||||
end;
|
||||
Result := DosExitCode;
|
||||
end;
|
||||
|
||||
|
||||
function ExecuteProcess (const Path: unicodeString;
|
||||
const ComLine: array of unicodeString;Flags:TExecuteFlags=[]): integer;
|
||||
|
||||
var
|
||||
CommandLine: UnicodeString;
|
||||
I: integer;
|
||||
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user