Reading a file from an alternate location

Posted by Highstaker on Super User See other posts from Super User or by Highstaker
Published on 2013-11-12T09:02:23Z Indexed on 2013/11/12 10:00 UTC
Read the original article Hit count: 176

Filed under:
|

I have a certain file (data.abc) located in, say, my home folder. I make a copy of it to another location (for example, "/mnt/ramtemp/").

Whenever the file in my home folder is accessed by any process, I want it to be read not from home folder, but from "/mnt/ramtemp/". As you might have guessed from the path of the latter, it is where I mount the ramfs. So, basically, I want a process to access not the file on my HDD (which is slower), but its copy on ramfs (which is way faster). At the same time, I want the file data.abc to remain in my home folder under that name, I don't want to rename or delete it. Is there any way I could guide the system to redirect the processes to read the file from alternative location whenever they try to read it from home folder?

© Super User or respective owner

Related posts about linux

Related posts about file