Java: Reading/Writing Mac OS X plist files

Discussion in 'Mac Programming' started by wrldwzrd89, Oct 31, 2008.

  1. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #1
    Is there any way to do this? I'm willing to limit this functionality to the Mac OS X platform, if that turns out to be necessary. If a library exists for this purpose, I'd strongly prefer that it be open-source. If using the "defaults" command is the way to go (which is the approach I tried), how exactly do you get this working?

    I've tried:
    Code:
    Runtime.getRuntime().exec("defaults write net.worldwizard.Whatever Three\ Word\ Key -type value");
    ...but nothing gets written. (Note: The string as given won't work - look at the man page for defaults for the syntax. The syntax I used is rather generic.)
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
  3. foidulus macrumors 6502a

    Joined:
    Jan 15, 2007
    #3
    Did you check to make sure that you can do the command

    outside of Java? You may very well have a permissions issue. Also, did you check the return value of the execution, that may very well hold some useful info.
     
  4. wrldwzrd89 thread starter macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #4

Share This Page