Path to virtual memory folder?

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

  1. macrumors regular

    Joined:
    Sep 29, 2009
    #1
    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

    Joined:
    Jun 4, 2009
    #2
    Code:
    ps -axo command | awk '$1 == "/sbin/dynamic_pager" { print $3 }'
    or maybe

    Code:
    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.
     

Share This Page