git-svn-id: trunk@6275 -
@@ -20,3 +20,11 @@ Function CreatePipeHandles (Var Inhandle,OutHandle : Longint) : Boolean;
begin
Result := False;
end;
+
+Function TInputPipeStream.GetNumBytesAvailable: DWord;
+begin
+ Result := 0;
+end;
@@ -13,10 +13,18 @@
**********************************************************************}
-// No pipes under dos, sorry...
+// No pipes under beos, sorry...
Function CreatePipeHandles (Var Inhandle,OutHandle : Longint) : Boolean;
@@ -20,3 +20,11 @@ Function CreatePipeHandles (Var Inhandle,OutHandle : THandle) : Boolean;
@@ -28,13 +28,17 @@ Type
EPipeSeek = Class (EPipeError);
EPipeCreation = Class (EPipeError);
+ { TInputPipeStream }
TInputPipeStream = Class(THandleStream)
Private
FPos : Int64;
+ function GetNumBytesAvailable: DWord;
public
Function Write (Const Buffer; Count : Longint) :Longint; Override;
Function Seek (Offset : Longint;Origin : Word) : longint;override;
Function Read (Var Buffer; Count : Longint) : longint; Override;
+ property NumBytesAvailable: DWord read GetNumBytesAvailable;
TOutputPipeStream = Class(THandleStream)
@@ -13,6 +13,7 @@
+// Unsupported for the moment...
Function CreatePipeHandles (Var Inhandle,OutHandle : THandle) : Boolean;
@@ -20,3 +21,10 @@ begin
Result := false; {dont know how to do that with netware clib}
Result := false; {todo}
@@ -24,3 +24,11 @@ Function CreatePipeHandles (Var Inhandle,OutHandle : Longint) : Boolean;
CreatePipeHandles := DosCreatePipe (InHandle, OutHandle, PipeBufSize) = 0;
+ // TODO: find out if this is possible in OS/2
@@ -14,8 +14,7 @@
Uses
- Unix
- ;
+ BaseUnix, Unix, TermIO;
@@ -23,3 +22,11 @@ begin
Result := (AssignPipe (Inhandle,OutHandle)<>-1);
+ if fpioctl(Handle, FIONREAD, @Result)<0 then
@@ -33,3 +33,11 @@ Function CreatePipeHandles (Var Inhandle,OutHandle : THandle) : Boolean;
Result := CreatePipe (@Inhandle,@OutHandle,@piInheritablePipe,PipeBufSize);
+ if not PeekNamedPipe(Handle, nil, 0, nil, @Result, nil) then
@@ -13,8 +13,18 @@
+ // Windows CE doesn´t have the API function PeekNamedPipe