Path to virtual memory folder?

Discussion in 'Mac Programming' started by nelly22, Mar 16, 2013.

  1. macrumors regular

    Sep 29, 2009
    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.
  2. macrumors member

    Jun 4, 2009
    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/
    Neither are terribly robust but depending on your needs might do.

Share This Page