1

I have a main Python program that invokes (via Popen) another program in C++. The two programs transfer files to one another, and these files are rather huge.

I want to be able to keep those files in RAM instead of writing them to disk from one program, and then reading it in the other program.

The point is that I can't really touch the code of the C++ program, only the Python one, and all I can do is to inject the C++ program with filesystem paths, so I need an abstraction of filesystem over RAM.

I've seen the option of using PyFileSystem, but I'm not sure whether it is possible to use the MemoryFS paths in an external program, just as if it was a regular mount point. Seems as if it is only usable via the API of the FS object itself. (Be glad to know whether I'm wrong here)

Eliran Abdoo
  • 611
  • 6
  • 17
  • Why don't you just setup a RAM drive? How depends on your OS. Google knows details. – Klaus D. Nov 14 '20 at 12:47
  • @KlausD. this would be my final resort, I'd rather to have a more Pythonic way of doing it, so it can be invoked from my Python program (preferably with no Popen usages, and ideally OS agnostic) – Eliran Abdoo Nov 14 '20 at 13:27
  • This site's core topics are to fix code and algorithms or help with using coding tool. We do not develop system architectures or recommend libraries to use. So, if you have any code to fix please add it to your question. – Klaus D. Nov 14 '20 at 13:32
  • @KlausD. If this is the case then I should close this post. Integrating some tool/library in my project would be quite easy, and indeed my question is more about library recommendation/architecture design. – Eliran Abdoo Nov 14 '20 at 13:50

0 Answers0