2025-09-09

[Mac] 新版 RamDisk for m系列 CPU

 之前寫的 RamDisk , 無法直接在 m系列 cpu 執行, 需要透過 rostanet 方式才能執行. 

做一版新的, 用新版得 工序指令編寫程式 , 重新開發一個新的. 


1. 調整使用 APFS 作為新的 檔案格式, HPF+ 舊格式, 就不用了

2. 要輸出成 應用程式,  原始檔可以跟 應用程式分開了

```

do shell script "

if ! test -e /Volumes/RamDisk ;  then

diskutil erasevolume APFS RamDisk `hdiutil attach -nomount ram://$((1*512*1024*2))`

mkdir -p /Volumes/RamDisk/Caches/Chrome

mkdir -p /Volumes/RamDisk/Caches/Safari

mkdir -p /Volumes/RamDisk/Caches/Firefox/trade

mkdir -p /Volumes/RamDisk/Caches/Firefox/longtai

mkdir -p /Volumes/RamDisk/Caches/Thunderbird


fi

"

```


[Mac] Firefox Cache 修改到 RamDisk

 firefox 是針對每一個 profile 有其對應的目錄. 所以需要針對每一個 profile 開啟相對應的 dir. 

以下 trade 為例. 

1.  新增一個 cache 路徑, /Volumes/RamDisk/Firefox/trade

2. 打開 firefox , 選擇 trade profile 進入 

3. 使用 about:config 進入修改畫面

4. 搜尋 browser.cache.disk.parent_directory , 如果沒有就新增一個植

5. 輸入 /Volumes/RamDisk/Firefox/trade

6. 刪除 profile 目錄下的 cache2.(舊的cache folder)