mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 13:06:18 +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;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString;Flags:TExecuteFlags=[]):integer;
|
function ExecuteProcess(Const Path: RawByteString; Const ComLine: RawByteString;Flags:TExecuteFlags=[]):integer;
|
||||||
var
|
var
|
||||||
e : EOSError;
|
e : EOSError;
|
||||||
CommandLine: AnsiString;
|
CommandLine: AnsiString;
|
||||||
@ -819,11 +819,50 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function ExecuteProcess (const Path: AnsiString;
|
function ExecuteProcess (const Path: RawByteString;
|
||||||
const ComLine: array of AnsiString;Flags:TExecuteFlags=[]): integer;
|
const ComLine: array of RawByteString;Flags:TExecuteFlags=[]): integer;
|
||||||
|
|
||||||
var
|
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;
|
I: integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user