How to keep a text file always in RAM for faster access?
My text file is shared across our LAN and must stay on the same place as it is now. I can't have it on another disk or location.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
If you are trying to access it from other programs or a text editor you can use ramdisk, which is free* software that allows you to create a virtual disk in your ram while your computer is booted, this is the most economical and easiest solution. It creates something like a partition in your computer's physical memory that you can then write to like an HDD or FlashDrive but with crazy fast read and write speeds.
If you want the file to appear to be a part of the drive that it is currently on you can make a ramdisk, and then using "Create and format hard disk partitions" (or disk part if you are comfortable with command-line software) you can mount the ramdisk as an NTFS folder. Just replace the current folder that the text file is in with the new "fake" folder that is the ramdisk. This way, all other computers won't even know that anything out of the ordinary is going on, but you will get your fast read and write speeds.
Here are some screen shots of mounting the drive as a folder.
Firstly: Open "Create and Format Hard Disk Partitions" find your ramdisk, right-click on the volume and click on "Change Drive Letter and Path" below is a screen shot of what you should get after doing that.
Then, enter the path you would like the ramdisk to be mounted as and click ok. You can either leave the existing drive letter that Windows assigned originally, or remove it altogether.
Lastly: Here is what you should get once you entered the pathname and removed the drive letter:
And now, you should be able to access that "folder" as you would any other part of your normal filesystem.
*ramdisk is free for disk sizes up to 1GB, which may be enough for any text file.
When you open the text file in a text editor or word processor, it's in RAM. It'll stay in RAM (or your pagefile) until you close it.
Betting you probably want the copy in RAM on your computer to automatically update when someone on the LAN changes the file. You need a text editor or word processor that supports this.
If you only need read-only access to the file, you could open it up in a browser and refresh when you want an update.
Look into Offline Files. In short, when you make a network-shared folder "Available Offline," Windows will keep a copy of all those files on your computer. This allows you to use these files when you're not connected to the computer sharing that folder. And--as you specifically asked for--Windows can also use your local copy even when the share is available for faster access.