[fpc-pascal] File Descriptor in Windows ?

Michael Van Canneyt michael at freepascal.org
Sat Mar 21 23:06:13 CET 2015



On Sat, 21 Mar 2015, fredvs wrote:

> Hello.
>
> Added Pipes in uses section.
>
> Changed => AssignPipe(InHandle, FOutHandle);
> Into => CreatePipeHandles (InHandle, FOutHandle, PipeBufferSize);
>
> Then in code =>
> var
>  Http: TFPHTTPClient;
>  Output: THandleStream = nil;
>  URL: String;
> begin
>  Http := TFPHTTPClient.Create(nil);
>  Output := THandleStream.Create(FOutHandle);
>  URL := FWantedURL;
>   Http.RequestHeaders.Clear;
>  Http.Get(URL, Output);
>
> => Perfect for Linux, compiles + web procedure runs perfectly (like using
> fpPipe).
>
> In Windows, same code compiles ok but when trying to run the web procedure,
> Program gives that error =>
>
>> An unespected error occurred
>> File not open
>
> ? ;-(

What do you do with the inHandle ?

Michael.



More information about the fpc-pascal mailing list