You nailed it!  I'm most impressed :)  As I had updated to the latest gambit git source last night trying to solve things, I went ahead and just recompiled the lib with '--enable-debug' first (which I'll keep enabled till end of beta) and got the following:<br>

<br><div><div><font face="'courier new', monospace">[1308145045.216022][USER]: [init] DATA ROOT: /var/mobile/Applications/67AF0861-1AB4-43CD-8821-BFEEF287DEBA/gateway.app/data/</font></div>
<div><font face="'courier new', monospace">path="/var/mobile/Applications/67AF0861-1AB4-43CD-8821-BFEEF287DEBA/gateway.app/src/app/main.scm" fl=4</font></div><div><font face="'courier new', monospace">fd=6 kind=31 direction=1</font></div>

<div><font face="'courier new', monospace">*** OS ERROR AT "os_io.c"@6073.1 -- errno=1 (Operation not permitted)</font></div><div><br></div><div class="gmail_quote">It was, indeed, setting it to non-blocking that was generating it.  After adding your suggested mod, it now works again.  I was also able to replicate the error in your iOS Gambit REPL App with:</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">>  (open-input-file "~~/Info.plist")</div><div class="gmail_quote">*** ERROR IN (console)@1.1 -- Operation not permitted</div><div class="gmail_quote">
<br></div><div class="gmail_quote">I'll do up a sample native ObjC version of setting the file to non-blocking and submit it as a bug report to Apple.  Note: the same error occurs even for app created files placed in 'Documents'. Thanks!</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">   Adam</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Wed, Jun 15, 2011 at 7:44 AM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca" target="_blank">feeley@iro.umontreal.ca</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
On 2011-06-14, at 10:54 PM, Adam King wrote:<br>
<br>
>  Alright - that might very well be true - and it probably did say that in the 60 or more pages of legalese that I doubt most devs have time to read through.  I know... that's not a valid excuse  :)<br>
><br>
>  So, let me reframe the question: in what circumstances could 'with-input-from-file' and 'load' generate an 'Operation not permitted' error on a unix type system even when the file is readable?  I tried tracing both funcs in the gambit lib, but soon got lost.  Maybe the lib is doing more than just fopen/fread?  I thought Marc might have an idea.<br>


><br>
<br>
</div>On Mac OS X (and Unix) the path to the file is opened with a call to "open", and then the file descriptor is set to non-blocking mode with a call to set_fd_blocking_mode (defined in os_io.c) which calls fcntl(fd,F_GETFL, 0) and fcntl(fd,F_SETFL, ...).  You might want to change the call to set_fd_blocking_mode on line 6072 of os_io.c<br>


<br>
      if (set_fd_blocking_mode (fd, 0) != 0) /* set nonblocking mode */<br>
        return err_code_from_errno ();<br>
<br>
to<br>
<br>
      if (kind != ___FILE_DEVICE_KIND)<br>
        if (set_fd_blocking_mode (fd, 0) != 0) /* set nonblocking mode */<br>
          return err_code_from_errno ();<br>
<br>
and see if that eliminates the problem.  Of course this makes I/O to files blocking, so the thread multiplexing will not work when doing I/O to files.<br>
<br>
Have you tried compiling the Gambit library with the --enable-debug configuration flag?  It will output traces for all the system calls which return errors, with the name of the source file and line number where the error was detected.<br>


<font color="#888888"><br>
Marc<br>
<br>
</font></blockquote></div><br></div>