From a programming point of view, how would I go about coding a plugin that allows to apply 'real time' changes to a file, if that file is open in two different programs simultaneously?
One example I can think of would be Cineware plugin for Cinema4D and AfterEffects. You can open a 3D model between Cinema4D and AfterEffects, if you make a change inside Cinema4D, it automatically applies that change in AfterEffects without having to export and import the file again.
I'm specifically looking to make such a link between Rhino and ArtCAM with .dxf files. I would like to have a file open in Rhino and ArtCAM at the same time and if I make changes within Rhino, those changes would apply to ArtCAM without having to export and import the file.
This page -> https://developer.rhino3d.com/guides/rhinopython/what-is-rhinopython/ states that Rhino.Python can be used to "Create realtime links to other applications", but I don't even know how to approach this problem.
The problem isn't that you need to read the same file simultaneously.. but rather that you need to access a read and write buffer from two seperate applications.
I would create a third application. A Synchronous File Server(SFS). When you need to read a file, an application sends a request to the SFS to open a file. A second application can send a request to open the same file. The SFS will hold only one file instance, but will buffer the data to 2 or more seperate socket streams when applications request to read or write.
At first you'll want to just make sure it works. But you will eventually want to optimise the SFS with caches to avoid jumping to the beginning/end of a file while writing from 2 seperate sockets.