[erlang-questions] RE: R14 vs R13 binary handling in driver_outputv

Tim Watson <>
Mon Mar 14 12:08:12 CET 2011


>
> Fixed. Now can anyone suggest a better way of consuming the binary in
> driver_outputv?
>

On further reading of the erl_driver source code, I can see I'm doing
this half baked. The obvious (and simple) solution is to use the
iov_len on each member to get the length, instead of passing it
explicitly. Hopefully by posting the answer, anyone looking in future
will be able to pick up on this. Based on the post at
http://www.erlang.org/pipermail/erlang-questions/2006-August/021897.html,
a little fiddling around with the inputs and it's clear that you can
just pass the binaries (i.e. [Xml, Xsl] and then some parameters if
you wish) to port_command and then use the vsize and iov_len (or
binv[x]->orig_size) to figure out the bounds and access the data.


More information about the erlang-questions mailing list