On Thu, Nov 29, 2012 at 1:25 PM, Nick Dokos <nicholas.do...@hp.com> wrote:
> >> But your earlier mail says that it is trying to create the temp file on the >> remote >> >> ,---- >> | > Tramp: Decoding region into remote file >> | > >> /ssh:midway:/var/folders/2y/qrw3hhkx0dlb9sbl51mjy5wm0000gn/T/sh-510999vN...done >> | > byte-code: Couldn't write region to >> | > >> `/ssh:midway:/var/folders/2y/qrw3hhkx0dlb9sbl51mjy5wm0000gn/T/sh-510999vN' >> `---- >> >> Not sure what causes tramp to use /var/folders/2y for remote temp files >> but that seems to be the main problem here. >> > > If you evaluate > > (tramp-compat-temporary-file-directory) > > on your local system, what do you get? > > tramp may be assuming that whatever temp directory you are using > on your local system should work on the remote as well, an > assumption that's not true in your case. You may have to provide > your own function to get around this - or use /tmp just like the > rest of the world. > It's exactly as you suspected, Nick. That crazy /var/folders/... value was apparently hard-coded in the value of temporary-file-directory out of the box. That must be something that happens in Macports. When I changed it to "/tmp" things appear to work better: #+BEGIN_SRC sh :dir /midway:~ echo "Executed by `whoami` on `hostname` in `pwd`" #+END_SRC #+RESULTS: : Executed by nbest on lep in /Users/nbest The temp file problem was preventing any results from appearing, but now we see that the code is being executed locally, as suspected. There is a work-around for this, however: M-x ssh. #+BEGIN_SRC sh :session *ssh-midway* echo "Executed by `whoami` on `hostname` in `pwd`" #+END_SRC #+RESULTS: : Executed by nbest on midway-login1 in /pwd/from/that/session This opens up some possibilities but probably does not address the shortcomings detailed in the thread that Nick points to. The elisp hacking going on there is over my head so I will play with this some more and watch for updates.