× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Richard Schoen wrote:
So when I call spawn(), is the job spawning as part of the same iSeries
job or separately ?

spawn() is similar, conceptually, to the SBMJOB command. It starts a new job, and runs a program in that new job.

However, with spawn(), the new job is a "child job" of the current one, and will report it's status to the current job. Consider looking up spawn() in the Information Center for more details.

What makes it really attractive in your situation is that you can start the job with file descriptors open that map to pipes, and you can read the pipes from your current job. You can't easily do that with SBMJOB.

But, it definitely starts a separate job.


I'm actually calling a CL program that calls the QP2SHELL to call the
SAMBA API's to transfer a file. I need to capture the STDOUT responses
so I'm thinking your RPG spawn example should work as a starting point
and I want to get the data from the pipe that captures STDOUT, correct ?

I've written quite a few RPG spawn examples -- so I'm not sure which one you're referencing -- but I guess it doesn't matter... spawn() should be able to run PASE programs and use it to capture the output. waitpid() should be able to give you the exit status, as well.

That assumes you're running a Samba program -- like smbclient -- as opposed to an actual API (calling a function in a shared library).


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.