Passing data between filepro tasks
Brian K. White
brian at aljex.com
Fri Jun 17 12:24:29 PDT 2011
On 6/17/2011 3:11 PM, Brian K. White wrote:
> On 6/17/2011 2:04 PM, Jay Ashworth wrote:
>> ----- Original Message -----
>>> From: "Del"<del at altsystem.com>
>>
>>> In the Windows environment (which I seldom work in), I am writing a
>>> filepro program that executes other existing pgms using the ‘system
>>> “dclerk etc, etc”’ command. This works great, and I can pass values
>>> from the “mother” task to the “daughter” tasks using the flags –rw,
>>> –rx, –ry. My question is, what is the best way to pass values back
>>> from the “daughter” to the “mother”? I can think of a couple of clumsy
>>> ways, don’t know of a really nifty one. Don’t really want to create a
>>> file to do this, but will if I have to.
>>
>> You *may* be able to use SETENV and GETENV for this: in Windows, processes
>> all live in the same process space, unlike Unix, where the parent can't see
>> changes made in child processes... but you'd have to test this, as I never
>> have. Your code is *guaranteed* not to be portable to Unix if you do this,
>> though, so keep that in mind.
>>
>> Cheers,
>> -- jra
>
> Similarly, on unix you can write and read to/from a named pipe but not
> on windows.
>
> I'd just go ahead and use the file. It's not _that_ bad in terms of
> programming work especially once you do it a few times. And the OS and
> hardware will mostly magic-away the inefficiency of creating, writing,
> reading, deleting a file thanks to caching. And it'll work the same
> everywhere. And if the processes are both filepro, and both in the same
> filepro directory, then it's even simpler since the intermediary file
> can be a filepro file and you're using lookups instead of raw file i/o
> commands.
>
Also another thing, you can't use it on windows but just for
completeness, user() also provides a two-way communication channel
between a filepro parent and a anything-else child. It requires very
special care and very special conditions to use, but it is a two-way
channel between parent and child that doesn't involve a temp file.
Newer version of fp have networking functions you can enable, then you
can talk via raw tcp port. I don't remember if that's available on
windows but I don't see what it shouldn't be.
--
bkw
More information about the Filepro-list
mailing list