Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
3  
Leaving it open in a text editor isn't good enough? –  Ƭᴇcʜιᴇ007 Jul 19 '12 at 1:57
2  
Hello Johan, could you please explain the problem more detailed? From what I understand, you have a text file in a remote location and you need fast access to it. Do you also need to lock the file, e.g. no one else accesses / writes to it? –  hasgarion Jul 19 '12 at 6:37
1  
What OS is running on your computer and what OS is used on the server providing the text file? –  Robert Jul 19 '12 at 7:58

3 Answers 3

up vote 5 down vote accepted

If you are trying to access it from other programs or from 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 economic and easiest solution. It creates something like a partition in your computer's physical memory that you can then write to like a 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 actually 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. iamge

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 all together.

Lastly: Here is what you should get once you entered the pathname and removed the drive letter: image2

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 4GB, wich is more than any text file I've ever seen before!

share|improve this answer
1  
Looked into RAMDISK. 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. more recommendations please. –  Johan Larsson Jul 19 '12 at 0:43
    
I added a section to the answer that should help you accomplish what you would like to do. –  Keegan McCarthy Jul 19 '12 at 5:41
1  
This is exactly what I would have done, right down to changing the path that the ramdisk appears at. You would also need to enable the "save ramdisk" option if using the Dataram Ramdisk (or otherwise keep the data regularly backed up elsewhere) as otherwise all the data will be lost on resetting the computer. You may still loose some data if the computer crashes though hopefully that would not be too much. –  Mokubai Jul 19 '12 at 8:22

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.