[OSC_dev] No dumpOSC output in pipe in non-interactive terminal

Stephen Sinclair radarsat1 at gmail.com
Sat Sep 8 12:14:49 PDT 2007


Hello,

Torsten, I do suggest you link to an OSC static library instead of
depending on an external executable, because it's quite a round-about
solution to read a binary stream, convert it to ASCII, pass it through
a socket, and then convert it back to binary.  Not only is this very
inefficient, but you are losing precision in your floating point
values.

However, if you do want to call an external program and capture its
output, I suggest looking up the "popen" function.  It executes a
program and returns a pipe for you to read and write which are
connected to the standard input and standard output of the program.
This is what you want to use in a Unix environment.

If you need to do something similar on Windows, it isn't as easy, but
it is certainly possible..
Here's an example of how to do it on Windows:
http://svn.abisource.com/abiword-plugins/trunk/wp/scripts/shell/win/fakepopen.cpp


Steve


On 9/8/07, Torsten Anders <torsten.anders at plymouth.ac.uk> wrote:
> Dear all,
>
> just to inform: I found some hackerish way around it: I am calling
> dumpOSC in an interactive terminal and use netcat to send its output
> to my application via a socket. So, all OSC traffic goes though the
> network twice, once encoded and then as plain text (see below). Not
> necessarily the most efficient way, but most easy to implement ;-)
>
>    ./dumpOSC -quiet 1234 | nc localhost 50001
>
> Thanks again for your comments -- and would still be happy to learn
> why dumpOSC doesn't output in a non-interactive 'terminal'.
>
> Best
> Torsten
>
> --
> Torsten Anders
> Interdisciplinary Centre for Computer Music Research
> University of Plymouth
> http://strasheela.sourceforge.net
> http://www.torsten-anders.de
>
>
> _______________________________________________
> OSC_dev mailing list
> OSC_dev at create.ucsb.edu
> http://www.create.ucsb.edu/mailman/listinfo/osc_dev
>


More information about the OSC_dev mailing list