From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Albinus Subject: Re: org mode R remote code evaluation Date: Thu, 26 Sep 2013 10:11:35 +0200 Message-ID: <87k3i4knns.fsf@gmx.de> References: <87d2ownbtv.fsf@hornfels.zedat.fu-berlin.de> <87r4ce2x8k.fsf@gmx.de> <87mwn22vy8.fsf@gmx.de> <878uymyser.fsf@gmx.de> <87y56li3je.fsf@gmx.de> <87mwn0u5sh.fsf@gmail.com> <87wqm4yb8w.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VP6fv-0001we-N8 for emacs-orgmode@gnu.org; Thu, 26 Sep 2013 04:11:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VP6fo-0008C7-9v for emacs-orgmode@gnu.org; Thu, 26 Sep 2013 04:11:51 -0400 Received: from mout.gmx.net ([212.227.15.18]:58327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VP6fo-00089v-0F for emacs-orgmode@gnu.org; Thu, 26 Sep 2013 04:11:44 -0400 Received: from detlef.gmx.de ([91.41.130.35]) by mail.gmx.com (mrgmx003) with ESMTPS (Nemesis) id 0MBFUT-1VYh2p0VyX-00AHMK for ; Thu, 26 Sep 2013 10:11:42 +0200 In-Reply-To: (Alexander Vorobiev's message of "Wed, 25 Sep 2013 15:36:05 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alexander Vorobiev Cc: Loris Bennett , emacs-orgmode , Johannes Rainer , Eric Schulte Alexander Vorobiev writes: > Michael, Hi Alex, > * this doesn't work > #+BEGIN_SRC sql :engine postgresql :dir /grid: :results output > select 1+2 as three; > #+END_SRC > > /plinkx:grid:/tmp/sql-in-7928arv...done > psql -A -F " " -f "c:/tmp/sql-in-7928arv" -o "c:/tmp/sql-out-7928Z_E" > -f c:/tmp/sql-in-7928arv -o c:/tmp/sql-out-7928Z_E > No such file or directory 'c:/tmp/sql-in-7928arv' Try this extended patch: --8<---------------cut here---------------start------------->8--- diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 5a032a1..2789f47 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2680,11 +2680,7 @@ Fixes a bug in `tramp-handle-call-process-region'." (defun org-babel-local-file-name (file) "Return the local name component of FILE." - (if (file-remote-p file) - (let (localname) - (with-parsed-tramp-file-name file nil - localname)) - file)) + (or (file-remote-p file 'localname) file)) (defun org-babel-process-file-name (name &optional no-quote-p) "Prepare NAME to be used in an external process. @@ -2694,7 +2690,10 @@ remotely. The file name is then processed by `expand-file-name'. Unless second argument NO-QUOTE-P is non-nil, the file name is additionally processed by `shell-quote-argument'" ((lambda (f) (if no-quote-p f (shell-quote-argument f))) - (expand-file-name (org-babel-local-file-name name)))) + ;; We must apply `expand-file-name' on the whole filename. If we + ;; would apply it on the local filename only, undesired effects + ;; like prepending a drive letter on MS Windows could happen. + (org-babel-local-file-name (expand-file-name name)))) (defvar org-babel-temporary-directory) (unless (or noninteractive (boundp 'org-babel-temporary-directory)) @@ -2736,7 +2735,7 @@ of `org-babel-temporary-directory'." (if (file-remote-p default-directory) (let ((prefix (concat (file-remote-p default-directory) - (expand-file-name prefix temporary-file-directory)))) + (expand-file-name prefix "/tmp/")))) (make-temp-file prefix nil suffix)) (let ((temporary-file-directory (or (and (boundp 'org-babel-temporary-directory) --8<---------------cut here---------------end--------------->8--- > Thanks > Alex Best regards, Michael. PS: the analysis of your cygwin problem is delayed. I don't run MS Windows on my machines, I need to hijack a machine from my wife or somebody else for analysis.