PDA

View Full Version : Path to virtual memory folder?




nelly22
Mar 16, 2013, 07:51 AM
Is there any way in AppleScript/Unix to get path to virtual memory folder (/private/var/vm), similar way than (path to desktop)?

We have many Macs and some Macs keep virtual memory in non standard place.



cqexbesd
Mar 16, 2013, 03:51 PM
ps -axo command | awk '$1 == "/sbin/dynamic_pager" { print $3 }'

or maybe

xpath "/plist/dict/key[text()='ProgramArguments']/following::array/string[3]/text()" < /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist

Neither are terribly robust but depending on your needs might do.