www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - passing data from one d app to another

reply jake <jake.day clayton.net> writes:
I was wondering how I would go about allowing one application to send data to
another. I would assume I would do this using a DLL. For example, I have a
program that contains a function to read a text file and parse it, and I'd like
an entirely different program to send what file to use to that program and have
it run it. Also, it needs to be able to parse it multiple times, meaning if 5
other apps also send it something.

Any pointers?
Jan 09 2008
next sibling parent reply BCS <BCS pathlink.com> writes:
jake wrote:
 I was wondering how I would go about allowing one application to send data to
another. I would assume I would do this using a DLL. For example, I have a
program that contains a function to read a text file and parse it, and I'd like
an entirely different program to send what file to use to that program and have
it run it. Also, it needs to be able to parse it multiple times, meaning if 5
other apps also send it something.
 
 Any pointers?

My first though was a pipe of some kind (network socket, unix domain socket, etc) my next though was a pipeline (use the pipe system call followed by fork and exec) my next though was memory-mapping/shared-memory. My last though is I'm glad it's your problem and not mine. <g>
Jan 09 2008
parent jake <jake.day clayton.net> writes:
BCS Wrote:

 jake wrote:
 I was wondering how I would go about allowing one application to send data to
another. I would assume I would do this using a DLL. For example, I have a
program that contains a function to read a text file and parse it, and I'd like
an entirely different program to send what file to use to that program and have
it run it. Also, it needs to be able to parse it multiple times, meaning if 5
other apps also send it something.
 
 Any pointers?

My first though was a pipe of some kind (network socket, unix domain socket, etc) my next though was a pipeline (use the pipe system call followed by fork and exec) my next though was memory-mapping/shared-memory. My last though is I'm glad it's your problem and not mine. <g>

Nevermind, I was trying sockets as I tried that and it works fine... Thanks! -Jake (aka okibi)
Jan 09 2008
prev sibling parent Frank Benoit <keinfarbton googlemail.com> writes:
jake schrieb:
 I was wondering how I would go about allowing one application to send data to
another. I would assume I would do this using a DLL. For example, I have a
program that contains a function to read a text file and parse it, and I'd like
an entirely different program to send what file to use to that program and have
it run it. Also, it needs to be able to parse it multiple times, meaning if 5
other apps also send it something.
 
 Any pointers?

this is called inter process comunication aka IPC Here are the solutions that came to my mind: - passing files - unix file sockets - network sockets - shared memory - Windows COM - Corba (no d support afaik) - DBus (dsource dbus-d) - Tango clusters
Jan 09 2008