[fpc-pascal] File Descriptor in Windows ?

fredvs fiens at hotmail.com
Thu Mar 26 18:12:42 CET 2015


For info, here answer from mpg123 creator =>

> 4) Assisgn input pipe stream => 
>   mpg123_open_fd(MyMPHandle,InHandle);  
>   => Crash on Windows, OK on Linux.

I don't have my head wrapped around the pascal bindings, but are you
handing your pipe handle to mpg123_open_fd() without change? What
should the mpg123 C code, expecting a C library file descriptor, do
with your handle created in Pascal/Delphi with whatever runtime in the
background? File descriptors may be compatible, but don't have to.

If that is really the case here, it would be best not to include
mpg123_open_fd() in a Pascal binding at all, or altenatively, make it a
wrapper that actually used mpg123_open_handle() and handles the I/O
conversion itself.

As I said, I didn't look closer, but it appears to me that you're just
lucky on Linux since Pascal and C share more runtime environment.

Alrighty then,



Many thanks ;-)
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/File-Descriptor-in-Windows-tp5721448p5721507.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

More information about the fpc-pascal mailing list