I'm looking for a library that allows to create a "fake" directory in RAM and get path to it that would work like a path to normal directory on disk.
My scenario is that I have a python script that executes another program (third party that I cannot modify) but it produces files and writes them to a specified location. Then, in my script, I read these files and do something with them. It's slow and I know that the bottleneck here is reading/writing files to/from disk (even if it's SSD).
Is it possible that I don't change the core of my script and only replace the temporary folder path that I use to store intermediate files? I don't need them and I remove them after they are processed.
The perfect solution would be something like this:
import fakeRAM
tmp_dir_path = fakeRAM.get_path()
...
os.system("program.exe " + tmp_dir_path)