Hi
I'd like to send an entire external text file (xml) over tcp on a bang. I'm currently struggling with the textfile object and netsend. Are there better ways?
Textfile assumes I want to send a line at a time, while netsend wants a message with "send" at the start and then the entire string I want to send. A message with "send $1" only sends the second word of any line.
Thanks
-poil-
Hallo, poil@apfrod.com hat gesagt: // poil@apfrod.com wrote:
I'd like to send an entire external text file (xml) over tcp on a bang. I'm currently struggling with the textfile object and netsend. Are there better ways?
Textfile assumes I want to send a line at a time, while netsend wants a message with "send" at the start and then the entire string I want to send. A message with "send $1" only sends the second word of any line.
To dynamically prepend a "send" in front of a list of unknown length you can use [list prepend send]. This will generate a message: "list send a b c d ..."
However [netsend] wants to get a message not starting with "list send" but only with "send ..." so you need to use an additional [list trim] to remove the "list"-part. All together this will be like this:
[textfile] | [list prepend send] | [list trim] | [netsend]
Frank Barknecht _ ______footils.org_ __goto10.org__
I just updated the net externals [tcpclient], [tcpserver], [tcpsend], [udpsend] so they accept a [send "file_name"( message. They are at: http://pure-data.cvs.sourceforge.net/pure-data/externals/mrpeach/net/ Martin
poil@apfrod.com wrote:
Hi
I'd like to send an entire external text file (xml) over tcp on a bang. I'm currently struggling with the textfile object and netsend. Are there better ways?
Textfile assumes I want to send a line at a time, while netsend wants a message with "send" at the start and then the entire string I want to send. A message with "send $1" only sends the second word of any line.
Thanks
-poil-
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list