Re: [O] org mode R remote code evaluation

2013-09-28 Thread Eric Schulte
Michael Albinus  writes:

> Eric Schulte  writes:
>
>> I'd rather not hard-code the value of "/tmp/".  Perhaps you could rework
>> the patch so that it introduces a new customizable variable (including a
>> documentation string) so that users can set the value for their system.
>>
>> Also, please package the patch with git format-patch.
>
> Patch is appended.
>

Applied, Thanks for the patch!

I've also added you to the list of contributors on worg, so I shouldn't
ask you to complete the FSF paperwork again :).

Cheers,

>
>> Thanks,
>
> Best regards, Michael.
>
>

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



Re: [O] org mode R remote code evaluation

2013-09-27 Thread Michael Albinus
Eric Schulte  writes:

> I'd rather not hard-code the value of "/tmp/".  Perhaps you could rework
> the patch so that it introduces a new customizable variable (including a
> documentation string) so that users can set the value for their system.
>
> Also, please package the patch with git format-patch.

Patch is appended.

> Thanks,

Best regards, Michael.

>From 2b8db5486de75ec35c2c0d3e6063847cf582ace7 Mon Sep 17 00:00:00 2001
From: Michael Albinus 
Date: Fri, 27 Sep 2013 13:34:03 +0200
Subject: [PATCH] * ob-core.el (org-babel-local-file-name): Simplify.
 (org-babel-process-file-name): Apply `expand-file-name' first.
 (org-babel-remote-temporary-directory): New defcustom. (org-babel-temp-file):
 Use it.

---
 lisp/ob-core.el | 19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 5a032a1..a7c227b 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))
@@ -2707,6 +2706,11 @@ additionally processed by `shell-quote-argument'"
 Used by `org-babel-temp-file'.  This directory will be removed on
 Emacs shutdown."))
 
+(defcustom org-babel-remote-temporary-directory "/tmp/"
+  "Directory to hold temporary files on remote hosts."
+  :group 'org-babel
+  :type 'string)
+
 (defmacro org-babel-result-cond (result-params scalar-form &rest table-forms)
   "Call the code to parse raw string results according to RESULT-PARAMS."
   (declare (indent 1)
@@ -2736,7 +2740,8 @@ 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 org-babel-remote-temporary-directory
 (make-temp-file prefix nil suffix))
 (let ((temporary-file-directory
 	   (or (and (boundp 'org-babel-temporary-directory)
-- 
1.8.1.2



Re: [O] org mode R remote code evaluation

2013-09-26 Thread Michael Albinus
Alexander Vorobiev  writes:

> #+BEGIN_SRC sql :engine postgresql :dir /grid: :results output :
> colnames yes
> select 2+2 as four, 1+1 as one;
> #+END_SRC
>
> #+RESULTS:
> | 4\t2 |
>
> It works! As you see there are still some problems with ob-sql (no
> column names and \t is not parsed correctly) but the remote execution
> seems to be fixed.

Great! I will prepare the patch tomorrow, as instructed by Eric.

> Thanks,
> Alex

Best regards, Michael.



Re: [O] org mode R remote code evaluation

2013-09-26 Thread Alexander Vorobiev
#+BEGIN_SRC sql :engine postgresql :dir /grid: :results output :colnames yes
  select 2+2 as four, 1+1 as one;
#+END_SRC

#+RESULTS:
| 4\t2 |

It works! As you see there are still some problems with ob-sql (no column
names and \t is not parsed correctly) but the remote execution seems to be
fixed.

Thanks,
Alex


On Thu, Sep 26, 2013 at 11:53 AM, Michael Albinus wrote:

> Alexander Vorobiev  writes:
>
> > Hi Michael,
>
> Hi Alex,
>
> > I can't apply the patch for some reason.
>
> Strange.
>
> > Could you send it and/or new ob-core.el as a attachment?
>
> It's appended.
>
> > Thanks,
> > Alex
>
> Best regards, Michael.
>
>


Re: [O] org mode R remote code evaluation

2013-09-26 Thread Michael Albinus
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.



Re: [O] org mode R remote code evaluation

2013-09-25 Thread Alexander Vorobiev
Michael,

I found that the patch doesn't work for sql code blocks. Here is an example

* this works
#+BEGIN_SRC sh :results output :dir /grid:
  ls
#+END_SRC

* this doesn't work
#+BEGIN_SRC sql :engine postgresql :dir /grid: :results output
  select 1+2 as three;
#+END_SRC

and here is what appears in *Messages*:

executing Sh code block...
Tramp: Encoding region using function `base64-encode-region'...done
Tramp: Decoding region into remote file
/plinkx:grid:/tmp/ob-input-7928Z4Q...done
Tramp: Encoding region using function `base64-encode-region'...done
Tramp: Decoding region into remote file
/plinkx:grid:/tmp/ob-error-7928zMd...done
Tramp: Encoding region using function `base64-encode-region'...done
Tramp: Decoding region into remote file
/plinkx:grid:/tmp/ob-input-7928Z4Q...done
Wrote /plinkx:grid:/tmp/ob-input-7928Z4Q
Code block evaluation complete.
executing Sql code block...
Tramp: Encoding region using function `base64-encode-region'...done
Tramp: Decoding region into remote file
/plinkx:grid:/tmp/sql-in-7928arv...done
Tramp: Encoding region using function `base64-encode-region'...done
Tramp: Decoding region into remote file
/plinkx:grid:/tmp/sql-out-7928Z_E...done
Tramp: Encoding region using function `base64-encode-region'...done
Tramp: Decoding region into remote file
/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'
Tramp: Inserting `/plinkx:grid:/tmp/sql-out-7928Z_E'...
Tramp: Encoding remote file /plinkx:grid:/tmp/sql-out-7928Z_E...done
Tramp: Decoding remote file /plinkx:grid:/tmp/sql-out-7928Z_E with function
base64-decode-region...
Wrote c:/Users/avorobi/AppData/Local/Temp/tramp.7928AeX
Tramp: Decoding remote file /plinkx:grid:/tmp/sql-out-7928Z_E with function
base64-decode-region...done
Tramp: Inserting `/plinkx:grid:/tmp/sql-out-7928Z_E'...done

So shell commands work but the arguments passed to psql have "c:" at the
beginning.

Thanks
Alex



On Wed, Sep 25, 2013 at 2:03 PM, Michael Albinus wrote:

> Eric Schulte  writes:
>
> > I'd rather not hard-code the value of "/tmp/".  Perhaps you could rework
> > the patch so that it introduces a new customizable variable (including a
> > documentation string) so that users can set the value for their system.
>
> Will do, tomorrow. I would even prefer a more general solution, a new
> function which returns a ("the") temp directory on a remote host. This
> would be useful also outside org-mode. But this would require changes in
> Emacs/Tramp, which won't be applicable for org immediately (backwards
> compatibility, and alike).
>
> > If you can keep the patch under 15LOC we can include it w/o requiring
> > FSF copyright assignment, otherwise see [1] for contribution details.
>
> No problem. As Tramp maintainer, I have signed the FSF papers for Emacs
> 10+ years ago. This shall be valid also for org patches.
>
> > Thanks,
>
> Best regards, Michael.
>


Re: [O] org mode R remote code evaluation

2013-09-25 Thread Michael Albinus
Eric Schulte  writes:

> I'd rather not hard-code the value of "/tmp/".  Perhaps you could rework
> the patch so that it introduces a new customizable variable (including a
> documentation string) so that users can set the value for their system.

Will do, tomorrow. I would even prefer a more general solution, a new
function which returns a ("the") temp directory on a remote host. This
would be useful also outside org-mode. But this would require changes in
Emacs/Tramp, which won't be applicable for org immediately (backwards
compatibility, and alike).

> If you can keep the patch under 15LOC we can include it w/o requiring
> FSF copyright assignment, otherwise see [1] for contribution details.

No problem. As Tramp maintainer, I have signed the FSF papers for Emacs
10+ years ago. This shall be valid also for org patches.

> Thanks,

Best regards, Michael.



Re: [O] org mode R remote code evaluation

2013-09-25 Thread Eric Schulte
Michael Albinus  writes:

> Alexander Vorobiev  writes:
>
>> Hi Michael,
>
> Hi Alex,
>
>> The patch seems to be working, the only thing I noticed is having
>> http://www.emacswiki.org/emacs/setup-cygwin.el loaded together with
>> the patched ob-core.el makes tramp prepend "/cygwin" to /tmp/. When I
>> disabled (require 'setup-cygwin) the patch works as expected. Outside
>> of org/babel setup-cygwin has no effect on Tramp.
>
> This problem does not seem to be related to org-mode code. Could
> somebody, please, commit my patch to org's repository? Thanks.
>

I'd rather not hard-code the value of "/tmp/".  Perhaps you could rework
the patch so that it introduces a new customizable variable (including a
documentation string) so that users can set the value for their system.

If you can keep the patch under 15LOC we can include it w/o requiring
FSF copyright assignment, otherwise see [1] for contribution details.
Also, please package the patch with git format-patch.

Thanks,

>
> I will try to find out what's up with Tramp and Cygwin. Sadly, it has
> been a misalliance very often :-(
>
>> Thanks,
>> Alex
>
> Best regards, Michael.
>


Footnotes: 
[1]   http://orgmode.org/worg/org-contribute.html

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



Re: [O] org mode R remote code evaluation

2013-09-25 Thread Michael Albinus
Alexander Vorobiev  writes:

> Hi Michael,

Hi Alex,

> The patch seems to be working, the only thing I noticed is having
> http://www.emacswiki.org/emacs/setup-cygwin.el loaded together with
> the patched ob-core.el makes tramp prepend "/cygwin" to /tmp/. When I
> disabled (require 'setup-cygwin) the patch works as expected. Outside
> of org/babel setup-cygwin has no effect on Tramp.

This problem does not seem to be related to org-mode code. Could
somebody, please, commit my patch to org's repository? Thanks.

I will try to find out what's up with Tramp and Cygwin. Sadly, it has
been a misalliance very often :-(

> Thanks,
> Alex

Best regards, Michael.



Re: [O] org mode R remote code evaluation

2013-09-24 Thread Alexander Vorobiev
Hi Michael,

The patch seems to be working, the only thing I noticed is having
http://www.emacswiki.org/emacs/setup-cygwin.el loaded together with the
patched ob-core.el makes tramp prepend "/cygwin" to /tmp/. When I disabled
(require 'setup-cygwin) the patch works as expected. Outside of org/babel
setup-cygwin has no effect on Tramp.

Thanks,
Alex


On Tue, Sep 24, 2013 at 1:40 PM, Michael Albinus wrote:

> Alexander Vorobiev  writes:
>
> > Hi Michael,
>
> Hi Alex,
>
> > Here it is.
>
> Thanks. I believe, the following patch shall cure it:
>
> --8<---cut here---start->8---
> --- a/lisp/ob-core.el
> +++ b/lisp/ob-core.el
> @@ -2735,8 +2735,12 @@
>  value of `temporary-file-directory' temporarily set to the value
>  of `org-babel-temporary-directory'."
>(if (file-remote-p default-directory)
>(let ((prefix
> +;; We cannot use `temporary-file-directory' as local part
> +;; on the remote host, because it might be another OS
> +;; there.  So we assume "/tmp", which ought to exist on
> +;; relevant architectures.
>   (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---
>
> Could you, please, test?
>
> > Thanks,
> > Alex
>
> Best regards, Michael.
>


Re: [O] org mode R remote code evaluation

2013-09-24 Thread Michael Albinus
Alexander Vorobiev  writes:

> Hi Michael,

Hi Alex,

> Here it is.

Thanks. I believe, the following patch shall cure it:

--8<---cut here---start->8---
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -2735,8 +2735,12 @@
 value of `temporary-file-directory' temporarily set to the value
 of `org-babel-temporary-directory'."
   (if (file-remote-p default-directory)
   (let ((prefix
+;; We cannot use `temporary-file-directory' as local part
+;; on the remote host, because it might be another OS
+;; there.  So we assume "/tmp", which ought to exist on
+;; relevant architectures.
  (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---

Could you, please, test?

> Thanks,
> Alex

Best regards, Michael.



Re: [O] org mode R remote code evaluation

2013-09-24 Thread Michael Albinus
Alexander Vorobiev  writes:

> Here is what I have:
>
> ELISP> emacs-version
> "24.3.1"
> ELISP> tramp-version
> "2.2.7"
> ELISP> org-version
> "8.2"

Well, that sounds recent. Could you, please, perform (setq tramp-verbose 6)
prior your test? There will be a Tramp debug buffer, which I would like
to analyze.

> Thanks,
> Alex

Best regards, Michael.



Re: [O] org mode R remote code evaluation

2013-09-24 Thread Alexander Vorobiev
Here is what I have:

ELISP> emacs-version
"24.3.1"
ELISP> tramp-version
"2.2.7"
ELISP> org-version
"8.2"

Thanks,
Alex


On Tue, Sep 24, 2013 at 7:57 AM, Michael Albinus wrote:

> Alexander Vorobiev  writes:
>
> > The ":results output" doesn't help in my setup (I'm on Windows, the
> > remote system is linux, access is via putty/plink)
>
> I do not run Windows, so I cannot reproduce exactly. However, ...
>
> > #+BEGIN_SRC sh :results output :dir /grid:
> > ls
> > #+END_SRC
> >
> > executing Sh code block...
> > Tramp: Encoding region using function `base64-encode-region'...done
> > Tramp: Decoding region into remote file
> > /plinkx:grid:/Users/avorobi/AppData/Local/Temp/ob-input-6116fuY...done
> > byte-code: Couldn't write region to
> > `/plinkx:grid:/Users/avorobi/AppData/Local/Temp/ob-input-6116fuY',
> > decode using `tramp_perl_decode_with_module >%s' failed
> >
> > The /Users directory obviously does not exist on linux.
>
> ... this looks like an old problem. Which Emacs/Tramp version are you
> using?
> Check variables `emacs-version' and `tramp-version'.
>
> > Thanks,
> > Alex
>
> Best regards, Michael.
>


Re: [O] org mode R remote code evaluation

2013-09-24 Thread Michael Albinus
Alexander Vorobiev  writes:

> The ":results output" doesn't help in my setup (I'm on Windows, the
> remote system is linux, access is via putty/plink)

I do not run Windows, so I cannot reproduce exactly. However, ...

> #+BEGIN_SRC sh :results output :dir /grid:
> ls
> #+END_SRC
>
> executing Sh code block...
> Tramp: Encoding region using function `base64-encode-region'...done
> Tramp: Decoding region into remote file
> /plinkx:grid:/Users/avorobi/AppData/Local/Temp/ob-input-6116fuY...done
> byte-code: Couldn't write region to
> `/plinkx:grid:/Users/avorobi/AppData/Local/Temp/ob-input-6116fuY',
> decode using `tramp_perl_decode_with_module >%s' failed
>
> The /Users directory obviously does not exist on linux.

... this looks like an old problem. Which Emacs/Tramp version are you using?
Check variables `emacs-version' and `tramp-version'.

> Thanks,
> Alex

Best regards, Michael.



Re: [O] org mode R remote code evaluation

2013-09-23 Thread Alexander Vorobiev
The ":results output" doesn't help in my setup (I'm on Windows, the remote
system is linux, access is via putty/plink)

#+BEGIN_SRC sh :results output :dir /grid:
  ls
#+END_SRC

executing Sh code block...
Tramp: Encoding region using function `base64-encode-region'...done
Tramp: Decoding region into remote file
/plinkx:grid:/Users/avorobi/AppData/Local/Temp/ob-input-6116fuY...done
byte-code: Couldn't write region to
`/plinkx:grid:/Users/avorobi/AppData/Local/Temp/ob-input-6116fuY', decode
using `tramp_perl_decode_with_module >%s' failed

The /Users directory obviously does not exist on linux.

Tramp itself works in my configuration, I can open files, etc. I have the
latest org-mode from elpa.

Thanks,
Alex


On Thu, Aug 29, 2013 at 5:42 AM, Johannes Rainer <
johannes.rai...@i-med.ac.at> wrote:

> thanks! so the ":results output" does the trick.
>
>
>
>
> On Thu, Aug 29, 2013 at 10:25 AM, Loris Bennett <
> loris.benn...@fu-berlin.de> wrote:
>
>> Johannes Rainer  writes:
>>
>> > dear all,
>> >
>> > I have some computation intense R-code that I want to run remotely on
>> my server,
>> > and, according to the org manual that should be possible with the ":dir"
>> > parameter. so I went on and tried the following (user/server masked):
>> >
>> > #+BEGIN_SRC R :dir /xx@xxx:
>> >   system("hostname")
>> > #+END_SRC
>> >
>> > when I execute it I get the error:
>> >
>> > Tramp: Encoding region using function `base64-encode-region'...done
>> > Tramp: Decoding region into remote file
>> > /ssh:xx@xxx
>> :/var/folders/ny/6kbb36310wz2kww8y8ctry60gn/T/R-46345BQs...done
>> > byte-code: Couldn't write region to
>> > `/ssh:xx@xxx
>> :/var/folders/ny/6kbb36310wz2kww8y8ctry60gn/T/R-46345BQs',
>> > decode using `base64 -d -i >%s' failed
>> >
>> > apparently, this temp folder does not exist on the linux server, it is
>> actually
>> > the temp folder from my local machine.
>> >
>> > I get the same error when I try to execute remote shell code, so it's
>> not R
>> > related.
>> >
>> > I also tried to start a ssh session using "M-x ssh" and used the source
>> block
>> >
>> > #+BEGIN_SRC R :exports both :session *ssh xxx*
>> > system("hostname")
>> > #+END_SRC
>> >
>> > on the server it executes the command but it can not write the results:
>> >
>> >> xxx
>> >> Warning message:
>> > In file.rename(tfile, transfer.file) :
>> >   cannot rename file '/tmp/RtmpsirjGl/file51c8f6ce4ec' to
>> >
>> '/var/folders/ny/6kbb36310wz2kww8y8ctry60gn/T/babel-46345zSH/R-46345a4N',
>> > reason 'No such file or directory'
>> >>
>> >
>> > I am using emacs 24.3 and Org-mode version 8.0.7
>> (release_8.0.7-384-g6fdc23)
>> >
>> > I would be helpful for any suggestions how I could solve this problem.
>> >
>> > thanks in advance
>>
>> The following works for me:
>>
>> #+BEGIN_SRC R :results output :dir /xxx@x:
>> system("hostname")
>> #+END_SRC
>>
>> with Emacs 24.2.1 and 8.0.7 (8.0.7-6-g13cb28-elpaplus)
>>
>> Cheers,
>>
>> Loris
>>
>> --
>> This signature is currently under construction.
>>
>>
>>
>
>
> --
> Johannes Rainer, PhD
> Applied Bioinformatics Group,
> Division Molecular Pathophysiology,
> Biocenter, Medical University Innsbruck,
> Innrain 80/82 II, 6020 Innsbruck, Austria
> and
> Tyrolean Cancer Research Institute
> Innrain 66, 6020 Innsbruck, Austria
>
> Tel.: +43 (0)512 9003 70961
> Email:  johannes.rai...@i-med.ac.at
> johannes.rai...@tcri.at
> URL:   http://bioinfo.i-med.ac.at
>
>
>


Re: [O] org mode R remote code evaluation

2013-08-29 Thread Johannes Rainer
thanks! so the ":results output" does the trick.




On Thu, Aug 29, 2013 at 10:25 AM, Loris Bennett
wrote:

> Johannes Rainer  writes:
>
> > dear all,
> >
> > I have some computation intense R-code that I want to run remotely on my
> server,
> > and, according to the org manual that should be possible with the ":dir"
> > parameter. so I went on and tried the following (user/server masked):
> >
> > #+BEGIN_SRC R :dir /xx@xxx:
> >   system("hostname")
> > #+END_SRC
> >
> > when I execute it I get the error:
> >
> > Tramp: Encoding region using function `base64-encode-region'...done
> > Tramp: Decoding region into remote file
> > /ssh:xx@xxx
> :/var/folders/ny/6kbb36310wz2kww8y8ctry60gn/T/R-46345BQs...done
> > byte-code: Couldn't write region to
> > `/ssh:xx@xxx
> :/var/folders/ny/6kbb36310wz2kww8y8ctry60gn/T/R-46345BQs',
> > decode using `base64 -d -i >%s' failed
> >
> > apparently, this temp folder does not exist on the linux server, it is
> actually
> > the temp folder from my local machine.
> >
> > I get the same error when I try to execute remote shell code, so it's
> not R
> > related.
> >
> > I also tried to start a ssh session using "M-x ssh" and used the source
> block
> >
> > #+BEGIN_SRC R :exports both :session *ssh xxx*
> > system("hostname")
> > #+END_SRC
> >
> > on the server it executes the command but it can not write the results:
> >
> >> xxx
> >> Warning message:
> > In file.rename(tfile, transfer.file) :
> >   cannot rename file '/tmp/RtmpsirjGl/file51c8f6ce4ec' to
> >
> '/var/folders/ny/6kbb36310wz2kww8y8ctry60gn/T/babel-46345zSH/R-46345a4N',
> > reason 'No such file or directory'
> >>
> >
> > I am using emacs 24.3 and Org-mode version 8.0.7
> (release_8.0.7-384-g6fdc23)
> >
> > I would be helpful for any suggestions how I could solve this problem.
> >
> > thanks in advance
>
> The following works for me:
>
> #+BEGIN_SRC R :results output :dir /xxx@x:
> system("hostname")
> #+END_SRC
>
> with Emacs 24.2.1 and 8.0.7 (8.0.7-6-g13cb28-elpaplus)
>
> Cheers,
>
> Loris
>
> --
> This signature is currently under construction.
>
>
>


-- 
Johannes Rainer, PhD
Applied Bioinformatics Group,
Division Molecular Pathophysiology,
Biocenter, Medical University Innsbruck,
Innrain 80/82 II, 6020 Innsbruck, Austria
and
Tyrolean Cancer Research Institute
Innrain 66, 6020 Innsbruck, Austria

Tel.: +43 (0)512 9003 70961
Email:  johannes.rai...@i-med.ac.at
johannes.rai...@tcri.at
URL:   http://bioinfo.i-med.ac.at


Re: [O] org mode R remote code evaluation

2013-08-29 Thread Loris Bennett
Johannes Rainer  writes:

> dear all,
>
> I have some computation intense R-code that I want to run remotely on my 
> server,
> and, according to the org manual that should be possible with the ":dir"
> parameter. so I went on and tried the following (user/server masked):
>
> #+BEGIN_SRC R :dir /xx@xxx:
>   system("hostname")
> #+END_SRC
>
> when I execute it I get the error:
>
> Tramp: Encoding region using function `base64-encode-region'...done
> Tramp: Decoding region into remote file
> /ssh:xx@xxx:/var/folders/ny/6kbb36310wz2kww8y8ctry60gn/T/R-46345BQs...done
> byte-code: Couldn't write region to
> `/ssh:xx@xxx:/var/folders/ny/6kbb36310wz2kww8y8ctry60gn/T/R-46345BQs',
> decode using `base64 -d -i >%s' failed
>
> apparently, this temp folder does not exist on the linux server, it is 
> actually
> the temp folder from my local machine.
>
> I get the same error when I try to execute remote shell code, so it's not R
> related.
>
> I also tried to start a ssh session using "M-x ssh" and used the source block
>
> #+BEGIN_SRC R :exports both :session *ssh xxx*
> system("hostname")
> #+END_SRC
>
> on the server it executes the command but it can not write the results:
>
>> xxx
>> Warning message:
> In file.rename(tfile, transfer.file) :
>   cannot rename file '/tmp/RtmpsirjGl/file51c8f6ce4ec' to
> '/var/folders/ny/6kbb36310wz2kww8y8ctry60gn/T/babel-46345zSH/R-46345a4N',
> reason 'No such file or directory'
>>
>
> I am using emacs 24.3 and Org-mode version 8.0.7 (release_8.0.7-384-g6fdc23)
>
> I would be helpful for any suggestions how I could solve this problem.
>
> thanks in advance

The following works for me:

#+BEGIN_SRC R :results output :dir /xxx@x:
system("hostname")
#+END_SRC

with Emacs 24.2.1 and 8.0.7 (8.0.7-6-g13cb28-elpaplus)

Cheers,

Loris

-- 
This signature is currently under construction.




[O] org mode R remote code evaluation

2013-08-28 Thread Johannes Rainer
dear all,

I have some computation intense R-code that I want to run remotely on my
server, and, according to the org manual that should be possible with the
":dir" parameter. so I went on and tried the following (user/server masked):

#+BEGIN_SRC R :dir /xx@xxx:
  system("hostname")
#+END_SRC

when I execute it I get the error:

Tramp: Encoding region using function `base64-encode-region'...done
Tramp: Decoding region into remote file /ssh:xx@xxx
:/var/folders/ny/6kbb36310wz2kww8y8ctry60gn/T/R-46345BQs...done
byte-code: Couldn't write region to
`/ssh:xx@xxx:/var/folders/ny/6kbb36310wz2kww8y8ctry60gn/T/R-46345BQs',
decode using `base64 -d -i >%s' failed

apparently, this temp folder does not exist on the linux server, it is
actually the temp folder from my local machine.

I get the same error when I try to execute remote shell code, so it's not R
related.

I also tried to start a ssh session using "M-x ssh" and used the source
block

#+BEGIN_SRC R :exports both :session *ssh xxx*
system("hostname")
#+END_SRC

on the server it executes the command but it can not write the results:

> xxx
> Warning message:
In file.rename(tfile, transfer.file) :
  cannot rename file '/tmp/RtmpsirjGl/file51c8f6ce4ec' to
'/var/folders/ny/6kbb36310wz2kww8y8ctry60gn/T/babel-46345zSH/R-46345a4N',
reason 'No such file or directory'
>

I am using emacs 24.3 and Org-mode version 8.0.7 (release_8.0.7-384-g6fdc23)

I would be helpful for any suggestions how I could solve this problem.

thanks in advance