A number of people have asked me about how to configure your computer so that !Scrap is always on a RAM Disc instead of running from the hard disc. This short article hopes to explain a simple way of achieving this so that you can gain the speed and security benefits.
STOP PRESS: You can now control this facility automatically, via my !Misc Setup !Boot plugin.
There are a number of reasons that I prefer running !Scrap from a RAM disc. These are:-
Speed | This is not so much of an issue on modern machines and fast hard drives, but having !Scrap on a RAM disc can speed up applications which make heavy use of !Scrap, such as Photodesk. |
Less wear and tear | Again, this shouldn't be an issue with reliable hard discs, but because !Scrap is probably one of the most frequently accessed parts of the hard disc, moving it to a RAM disc will avoid any stepping to the relevant spot on the hard disc and will eliminate repeated access to one particular area of the hard disc. |
Security | Arguably the most important reason. Having !Scrap on a RAM disc will ensure that the contents are completely lost when you shutdown the computer. This will ensure that no 'temporary' files are accidentally left behind if an application crashes or uses !Scrap whilst manipulating confidential information. |
Tidyness | Coupled with the security of deleting temporary files when the computer is shutdown, having !Scrap in RAM will also ensure that you don't end up with loads of junk saved on your hard disc. Even though applications should tidy their own scrap files, sometimes this doesn't always happen, and full !Scrap folders could be the cause of problems, especially on pre-RISC OS 4 systems which had a 77 file limit on directories. |
Before we do anything, we need to configure the computer to use a RAM disc. Double-click on !Boot and click on the Discs option. Enable the RAM disc and set the default size you require. I would recommend setting it to the maximum permissable, which is 128MB - although, obviously you will require enough RAM in your computer in the first place, which shouldn't be a problem if you're using an Iyonix.
Next, we need to store a 'virgin' !Scrap which is an unused version that we'll be copying to RAM on startup. The way I've organised by !Boot structure is that I've created an Extras sub-directory inside !Boot. This contains a number of additions I've added to !Boot over the years, and is a central place I can store any non-standard resources I've added. This is where we'll store a brand new, empty !Scrap folder, which will be copied to RAM disc on bootup.
If you're unsure about this, you can download a complete setup here, which you can de-archive and then drag over your existing !Boot.
This archive consists of both elements you need to do - a blank !Scrap sequence which you can store within !Boot.Extras and a small Obey file which goes inside your Tasks directory, which is run everytime you boot up your computer.
The Obey file consists of the following lines;
CDir RAM::RamDisc0.$.-system- Copy Boot:Extras.scrap.system.!Scrap RAM::RamDisc0.$.-system-.!Scrap ~CF~PR~V Filer_Run RAM::RamDisc0.$.-system-.!Scrap
I've only discovered two side-effects so far. One is that NetSurf stores it's font cache inside !Scrap, which means that if you delete !Scrap when you shutdown the machine, NetSurf will take ages to startup next time you load it. You can get around this by copying and restoring NetSurf's cache when you shutdown and reboot your machine.
When starting the machine you need to execute something like;
Copy Boot:Extras.scrap.system.!Scrap.ScrapDirs.ScrapDir.RUfl_cache RAM::RamDisc0.$.-sys tem-.!Scrap.ScrapDirs.ID3301010a.RUfl_cache ~CD~F~P~V(all one line)
and when shutting down the machine you need to execute something like;
Copy RAM::RamDisc0.$.-system-.!Scrap.ScrapDirs.ID3301010a.RUfl_cache Boot:Extras.scra p.system.!Scrap.ScrapDirs.ScrapDir.RUfl_cache ~CD~F~P~V(all one line)
If you use my NeXTBar desktop utility, you can add these two lines into the 'start' and 'stop' files respectively.
The other side-effect is that sometimes Photodesk will refuse to process enormous files. This is because it uses !Scrap for processing and you may find that even with 128MB for a RAM disc, it's not big enough to process a huge image. I don't think this a problem, but if it becomes an issue for you, you may want to reconsider running !Scrap from a RAM disc afterall.
If you shutdown and restart your computer, you should now find that !Scrap is run from RAM disc and you should immediately see the benefits.
Last edit: 10th Apr 2016 at 4:57pm (3164 days ago) |
|
| ||||||||||||||||||||