Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'UNIX script --This is what happens when i'm REALLY bored.' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
UNIX script --This is what happens when i'm REALLY bored.
Authored by: GaelicWizard on Jun 02, '02 01:55:59AM

Me again, I answered my own question. I don't know how efficient it is, but here's my script:


#!/bin/sh

echo -n "/dev/r" > /tmp/RamDisk.raw
hdid -nomount ram://10240 | awk -F / '{print $3}' > /tmp/RamDisk
cat /tmp/RamDisk >> /tmp/RamDisk.raw
newfs_hfs `cat /tmp/RamDisk.raw`
echo -n "/dev/" > /tmp/RamDisk.mount
cat /tmp/RamDisk >> /tmp/RamDisk.mount
hdiutil mount `cat /tmp/RamDisk.mount`



obviously, replace the 10240 with the size you want for your disk.

JP



[ Reply to This | # ]
UNIX script --This is what happens when i'm REALLY bored.
Authored by: robh on Jun 03, '02 09:28:03AM
I've made a Perl script to call the necessary commands: download it here Unlike the other suggestions so far, this one also lets you specify the name of the disk and does some error simple error checking. Usage: ramdisk MB_size [name] e.g. ramdisk 10 mydisk ramdisk 20 If you don't give a name, it defaults to "untitled".

[ Reply to This | # ]