Communication Via Text File

I've been trying to create a pair of programs that will run simultaneously where one writes to a text file while the other one reads it. The purpose of this is for a way to input into a program without it having to pause. I haven't gotten it to work and I wanted to know if it was actually possible to do this. Thank you for your time.
We can't write and read a file on the same time.
Do you want to share data between 2 processes? If it's right, I think you should use the following solution.

1. To share/transfer data between 2 processes. You can use "The file Mapping". At that time, one process create a file mapping and write data on them. After that, other process access address of file mapping to retrieve data.

2. Two processes can't read and write simultaneously. Therefore, we can use mutex to get permission to access memory.

Cuong Le
What kind of data are you talking about?

Is this small commands? Bulk data for processing? Or what??

Andy
What's the true application of this program, and why use text files? I could think of many ways to do this.. but your post was quite vague.
Topic archived. No new replies allowed.