title: Sandbox restricting freopen Mac OS X
body: <p>So I've got an app that was working nicely but when the sandbox was announced I figured I might as well as start complying.  In my app the user can call python and what I had been doing was a simple redirect of stdout and stderr</p>
  
  <pre><code>freopen("error.log","w",stderr);
  </code></pre>
  
  <p>and then call Python via a</p>
  
  <pre><code>status = PyRun_SimpleString(utfString);
  </code></pre>
  
  <p>From there I can simple readback results/errors and go on with life.  However with the sandbox this is not permitted as /dev/stdout and /dev/stderr are outside of my app.  I tried putting in temporary file exceptions in the entitlements:</p>
  
  <pre><code>com.apple.security.temporary-exception.files.absolute-path.read-write =&gt; Array
  {
      Item 0 =&gt; /dev/stdout
      Item 1 =&gt; /dev/stderr
  }
  </code></pre>
  
  <p>But that didn't help either...</p>
  
  <p>Does anyone know how to work around this?  This code was working fine and I understand the sandboxing but I'd like to keep the python interface simple and a quick redirect seems acceptable to me; after all, Everyone can write and read to stdout/stderr....</p>
  
  <p>Any help would be greatly appreciated.</p>