[fpc-pascal] How to poll for a byte in Input?

Jorge Aldo G. de F. Junior jagfj80 at gmail.com
Fri Dec 9 18:45:39 CET 2011


Thats an old problem on the way TStream was implemented.

I for one needed to know the result size of a uncompress stream (IE.:
i have a compressed stream and want to know in advance how many bytes
the uncompress method would yield).

The stream system is currently a mess, sometimes you can know in
advance how many bytes you can read, sometimes you cant, depends on
the class you are dealing with.

2011/12/9 tcoq <tcoq at free.fr>:
> On windows, I did not find WaitForSingleObject, which is actually going to wait for the file.
> However I found ReadFileEx in the Windows API, which is an asynchronous read on the file. I'll try using that.
>
> ----- Mail Original -----
> De: "Michael Van Canneyt" <michael at freepascal.org>
> À: "FPC-Pascal users discussions" <fpc-pascal at lists.freepascal.org>
> Envoyé: Vendredi 9 Décembre 2011 16h57:47 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
> Objet: Re: [fpc-pascal] How to poll for a byte in Input?
>>...
> You must use fpSelect() or Poll on the handle on linux/unix.
> On windows, you'll need to WaitForObject() or so on the file handle.
>
> Michael.
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal



More information about the fpc-pascal mailing list