mac os x有没有类似Linux下的/dev/shm可以作为虚拟内存盘来用
1
sweetomy 2015-03-09 21:54:22 +08:00
有类似的
|
2
lihua 2015-03-09 22:07:40 +08:00 1
|
3
TheCure 2015-03-09 22:38:56 +08:00
Apple Script就可以搞定
|
4
jsfaint 2015-03-10 10:22:24 +08:00 1
bash就能搞定
#!/bin/bash size=1024 usage() { echo "$0: Create RAM Disk with given size(default is 1024MB)" echo " e.g.: $0 512" exit 1 } if [[ $# -eq 1 ]]; then size=$1 re='^[0-9]*$' [[ ! $size =~ $re ]] && usage $0 else usage $0 fi sector=`echo "$size * 4 * 512" | bc` echo "Create ${size}MB RAM Disk" diskutil erasevolume HFS+ 'RAMDisk' `hdiutil attach -nomount ram://$sector` |
5
jakes 2015-03-10 21:21:25 +08:00
可以试试iRamDisk, 目前在用感觉不错。
|