>>I'm trying to port a set of perl test harness's from NT/Unix to OpenVMS
>and
>>most things seem to be ok , file io, system but not fork?
>
>What I'm trying to do is port a process control module, which creates a
>process , then asks it to run a specific command ( normally a java class),
>captures it output and error.
>The unix flavour uses Open3 which does not work on OpenVMS.
[snip]
>One of my big problems is my inability to understand the VMS
documentation,
>as it seems to say that fork, exec are supported.
Er, OpenVMS C RTL documentation or Perl on VMS documentation? Perhaps
things can be cleared up by unpacking Dan's comprehensive but cryptic
comment:
**
** perlvms documentation as all the document versions that I've found
** have listed fork & exec as supported methods
**
>VMS doesn't fork.
That is, Perl on VMS does not implement Perl's fork() function because most
Unixy uses of fork() make assumptions that won't work on VMS, so it seemed
better to skip it than to offer something that wouldn't work the way people
expect.
>We could open it up if the next call was to exec (which
>will work) but that's about it.
**
** This is one of these comments , that confuses me , what does we could
open it up mean ?
** I think a lot of my problems arise from my lack of understanding of how
perl is implemented
**
That is, we could make Perl's fork() on VMS work just like the C RTL's
fork() on VMS, which is to say that a fork() immediately followed by an
exec() will work. However, most Unix-style uses of fork() assume that you
are already executing in the child after the fork() and before the exec(),
and anything you do in there (like cloning output files) won't do what you
expect it to on VMS.
You might very well be able to do what you want by opening a pipe as long
as
you don't need both read and write access to the child.
**
** As a "temporary" to the open3/fork issues fix we've done a perl / C
wrapper to lib$spawn which returns the pid which we then monitor.
**
Regards
Tony O'Callaghan
Software Consultant
Storm Technology Ltd.
Phone: 091-509773
Fax: 091-509770
Mobile: 087-2227490
Email: [EMAIL PROTECTED]
http://www.storm.ie