Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-26 Thread Michael Van Canneyt
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 ;-(

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-26 Thread Sven Barth
Am 26.03.2015 08:26 schrieb Michael Van Canneyt mich...@freepascal.org: On Wed, 25 Mar 2015, Sven Barth wrote: On 25.03.2015 19:57, fredvs wrote: PS: Why everything must be so compilcated with Windows ? It's not if developers wouldn't decide to make their libraries so *nix centric...

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-26 Thread fredvs
Hello. 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

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-26 Thread Michael Van Canneyt
On Wed, 25 Mar 2015, Sven Barth wrote: On 25.03.2015 19:57, fredvs wrote: PS: Why everything must be so compilcated with Windows ? It's not if developers wouldn't decide to make their libraries so *nix centric... I don't understand this remark ? What is so *nix centric about a file

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-26 Thread Marc Weustink
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

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-25 Thread fredvs
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

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-25 Thread Michael Van Canneyt
On Wed, 25 Mar 2015, 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

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-25 Thread Andrew Haines
On 03/25/2015 08:23 AM, 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

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-25 Thread fredvs
It's not if developers wouldn't decide to make their libraries so *nix centric... Or when they will decide to develop their libraries with something else than C, that gives them compilers choice that are not compatible together (a library compiled with CGwin is not compatible with one compiled

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-25 Thread fredvs
@ Michael = They are available in default variables in the system unit: StdInputHandle,StdOutputHandle,StdErrHandle Yep, good to know, thank-you ;-) Sadly, it does not solve the problem... ;-( @ Andrew you could use mpg123_replace_reader_handle and mpg123_open_handle Ok, good idea, i will

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-25 Thread Sven Barth
On 25.03.2015 19:57, fredvs wrote: PS: Why everything must be so compilcated with Windows ? It's not if developers wouldn't decide to make their libraries so *nix centric... Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-25 Thread fredvs
@ Andrew Hum,... by the way,.. if,.. fortuitously (and by chance) you have already try it with your PulseAudio wrapper, could it be possible to show some code ? Ooops, i just check my mail now and =... Andrew, you are a Angel ;-) Tetra billion of thanks. PS: I will test it and give you news

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-22 Thread fredvs
@ Andrew Check for writeln's in the htmlthread unit you added. Hum, i did not add htmlthread unit (only fphttpclient and pipes). What do you mean ? @ Martin It should work, because TProcess relies on this function to do it's job. Yes, maybe, but it does not work ;-( Could it be a problem

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-22 Thread Michael Van Canneyt
On Sat, 21 Mar 2015, fredvs wrote: What do you do with the inHandle ? Michael. It is used by mp123 mp3-decoder library. =function mpg123_open_fd(mph: Tmpg123_handle; fd: integer); fp (file descriptor) := InHandle ; It seems that InHandle as file descriptor does not work on Windows. But

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-22 Thread fredvs
Check for writeln's in the htmlthread unit you added. Oops, i think i get it (sorry it is Sunday). ;-( - CreatePipeHandles (InHandle,OutHandle, PipeBufferSize); - Writeln('Input Handle = ' + inttostr(InHandle) + ' Output Handle = ' + inttostr(OutHandle)); = Linux = Input Handle = 3 Output

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-22 Thread fredvs
Yep, there is a answer from mpg123 creator in forum list ;-) = In Linux, no problem, i use the Input-Handle of a pipe as file descriptor. = mpg123_open_fd(MyMP123Handle, InputHandle) But if using Input-Handle of a pipe in Windows, at mpg123_read() i get that error: MPG123_BAD_RVA What

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread Michael Van Canneyt
On Sat, 21 Mar 2015, fredvs wrote: Hello. In Unix systems File Descriptor can be created with fpPipe(FDInput, FDOutput). Then FDInput/FDOutput may be used as file descriptors. Ok, perfect. But fpPipe is part of BaseUnix/Unix... So the question is: How to create such of File Descriptor

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread fredvs
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 :=

[fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread fredvs
Hello. In Unix systems File Descriptor can be created with fpPipe(FDInput, FDOutput). Then FDInput/FDOutput may be used as file descriptors. Ok, perfect. But fpPipe is part of BaseUnix/Unix... So the question is: How to create such of File Descriptor with Windows?... Many thanks. Fre;D 1)

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread fredvs
Hello. In Unix systems File Descriptor can be created with fpPipe(FDInput, FDOutput). Then FDInput/FDOutput may be used as file descriptors. Ok, perfect. But fpPipe is part of BaseUnix/Unix... So the question is: How to create such of File Descriptor with Windows?... See unit pipes,

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread fredvs
Re-hello. Tried with this too = Change = Output: THandleStream = nil; into = Output: TOutputPipeStream = nil; and Change = Output := THandleStream.Create(FOutHandle); into = Output:=TOutputPipeStream.Create (FOutHandle); = Compiles + works perfect in Linux ;-) = Compiles ok but does

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread Michael Van Canneyt
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 :=

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread Andrew Haines
Check for writeln's in the htmlthread unit you added. On March 21, 2015 6:23:44 PM EDT, fredvs fi...@hotmail.com wrote: What do you do with the inHandle ? Michael. It is used by mp123 mp3-decoder library. =function mpg123_open_fd(mph: Tmpg123_handle; fd: integer); fp (file descriptor) :=

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread fredvs
What do you do with the inHandle ? Michael. It is used by mp123 mp3-decoder library. =function mpg123_open_fd(mph: Tmpg123_handle; fd: integer); fp (file descriptor) := InHandle ; It seems that InHandle as file descriptor does not work on Windows. But in *nix system, it works. -