this function creates a RAM disk on Mac. it can be used for debug output, in case you want to have it faster or don't want to stress your SSD if the volume is already there, nothing is created keep in mind that RAM disks disappear after sleep or power off, so only use it as a debug output.
- Parameters
-
name | a std filename (don't use special characters or whitespace) |
sizeMB | the size of the RAM Disk in MB |
location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / mac_util.lua :38-49
function util.createMacRAMDisk(
name, sizeMB)
ug_assert(GetOperatingSystem() ==
"apple",
"only on apple systems")
os.execute("
if [ ! -e \"/Volumes/"..
name.."\" ]; then\n"..
"echo \"Creating ug4 RAM Disk with "..sizeMB.." MB..\"\n"..
"diskutil erasevolume HFS+ '"..
name.."' `hdiutil attach -nomount ram:
"echo \"Access the RamDisk in /Volumes/"..
name.."\"\n"..
"fi\n")
end
SynchronizeProcesses()
end
location name
Definition checkpoint_util.lua:128
function ug_assert(condition, msg)
if(!(yy_init))
Definition lexer.cpp:997