What are all the disadvantages of using files as a means of communicating between two processes?

Posted by Manny on Stack Overflow See other posts from Stack Overflow or by Manny
Published on 2010-05-22T14:20:25Z Indexed on 2010/05/22 14:30 UTC
Read the original article Hit count: 311

I have legacy code which I need to improve for performance reasons. My application comprises of two executables that need to exchange certain information. In the legacy code, one exe writes to a file ( the file name is passed as an argument to exe) and the second executable first checks if such a file exists; if does not exist checks again and when it finds it, then goes on to read the contents of the file. This way information in transferred between the two executables. The way the code is structured, the second executable is successful on the first try itself.

Now I have to clean this code up and was wondering what are the disadvantages of using files as a means of communication rather than some inter-process communication like pipes.Is opening and reading a file more expensive than pipes? Are there any other disadvantages? And how significant do you think would be the performance degradation.

The legacy code is run on both windows and linux.

© Stack Overflow or respective owner

Related posts about operating-system

Related posts about system-programming