What are the advantages of working directly with stdin, stdout and stderr?

2

Is there any advantage in terms of speed or some other aspect?

Show connections:

showConnections(all = TRUE)

Individual examples:

stdin()
stdout()
stderr()
    
asked by anonymous 22.09.2014 / 17:02

1 answer

2

To answer your question, let's understand what your problem is and what are the workarounds. Your problem is transferring data between two processes, R and Python. Here are some solutions to this problem:

  • Save the data to files that are accessed by both processes. Disk access is relatively slow. On the other hand, you do not need to re-run your programs to generate the data once it is written to disk.
  • Use network sockets . If both processes are on the same machine, communication is fast. The advantage is that your code will be prepared to transfer data between processes if they are placed on different machines.
  • Use stdin and stdout. In this case it will only work if both processes are on the same machine. Communication is fast. The advantage is that the code to read from the standard input and write to the standard output is quite simple.
23.09.2014 / 12:26