Org 执行 C 代码不支持远程路径?

我的电脑运行的是 Mac 系统,我想在跑 Linux 的 VPS 上运行这样一段 C 程序

#+BEGIN_SRC C :dir /xuchunyang.me:
#ifdef __APPLE__
puts("I am running on Mac or iOS");
#elif __linux__
puts("I am running on Linux");
#endif
#+END_SRC

但是会报

/bin/sh: 1: /scp:xuchunyang.me:/tmp/C-bin-19479eLn: not found

估计是写 ob-C.el 的人没有考虑到这种情况,不怎么熟悉 Org,不知道值不值的报告个 bug?不知道大家有没有类似的需求。

#+BEGIN_SRC sh :dir /xuchunyang.me:
lsb_release -a
#+END_SRC

#+RESULTS:
| Distributor ID: | Ubuntu             |
| Description:    | Ubuntu 16.04.2 LTS |
| Release:        | 16.04              |
| Codename:       | xenial             |

应该是个 bug,远程的文件其实是存在的:

  • Org-Babel Error Output

    /bin/sh: /scp:tokyo18:/tmp/C-bin-97475iBE: No such file or directory
    
  • 从终端执行

    $ ssh tokyo18 "/tmp/C-bin-97475iBE"
    Hello, world!
    
1 个赞

我已经向 Org 报告了这个问题:

http://lists.gnu.org/archive/html/emacs-orgmode/2017-04/msg00008.html

相信很快就能修复。

1 个赞