[fpc-pascal] File Descriptor in Windows ?

Michael Van Canneyt michael at freepascal.org
Thu Mar 26 10:30:12 CET 2015



On Wed, 25 Mar 2015, Marc Weustink wrote:

> fredvs wrote:
>> Hello.
>> 
>> Sorry to sorry to bother you with that file descriptors again... ;-(
>> 
>> There are some answers there on mpg123 forum.
>> They explain that "simple stdin/stdout file descriptors would work."
>> Of course all what they explained is in C ;-(
>> 
>> OK, but how can i use "simple stdin/stdout file descriptors" in Pascal ?
>> What is the code to retrieve that stdin/stdout file descriptors in Windows?
>
> What in unix is used as filedescriptor is in general in windows used as 
> handle (filehandle/sockethandle)
>
> Googling for "windows msdn stdin" resulted in:
> https://msdn.microsoft.com/en-us/library/windows/desktop/ms683231%28v=vs.85%29.aspx
>
> I've no clue why a lib should need this (and if a non console app would have 
> any)

IMHO:
The call is needed because unlike unix, stdinput, output and error file descriptors
are not equal to 0 1 2. So you need a call to retrieve the actual value.

The system unit calls these functions and stores the result in the variables I mentioned.

Michael.



More information about the fpc-pascal mailing list