[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem passing parms to spawned job



Hi Jairo,

You're right, parameters  via spawn() won't pass properly if they have 
embedded nulls.  This is because spawn() is modeled after the tools used 
on Unix systems, which only allow text parameters, and use 
null-terminated strings.

Consider connecting a pipe or data queue to the spawned job, and passing 
the data to the new job that way.  That should eliminate the problem.

Or if you really like parameters, use cvthc() to get a hex dump of the 
parameter (which will be all text), pass it, and use cvtch() to convert 
it back on the other end.

Either alternative should do the job.


jfloress@xxxxxxxxxxxxxxxxx wrote:
>    Hello everybody.
>    I'm working with an aplication that needs to open several conections
>    at the same time. For this reason i'm spawning jobs.
>    Each job, teorically, will connect to a server and wait for a
>    response(here's the HTTPAPI use).
>    The problem i have is, that i'm receiving some parameters that
>    contains null caracters(x'00') and i need to pass this parameters to
>    the spawned jobs.
>    Because only programs that expect arguments as null-terminated
>    character strings can be spawned, looks like the spawn API just pass
>    parameters with null-terminated caracters.
>    So when the controller job pass the parameters stream to the child
>    job,  with nulls within, the parameter arrives cutted off.
>    I really need some ideas.
>    Thank you all, but specially Scott, for this great set of tools.
>    [1]Jairo Román Flores Salgado
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------