create process with redirections

15 views
Skip to first unread message

Fabrice Le Fessant

unread,
Apr 28, 2016, 1:03:12 PM4/28/16
to ocaml...@googlegroups.com
Hi,

  I have another problem while translating Lwt code to Async: Lwt_process.exec can take a set of arguments containing `FD_MOVE fd for stdin, stdout and stderr, and redirecting directly the stdin/stdout/stderr of the created process to these file descriptors.

  Are there similar helper functions in Async ? I looked in Process, but stdin/stdout/stderr can only be accessed through the (active) use of Readers/Writers to forward data from the file to stdin, and from stdout/stderr to files. Is there something else that I can use ?

--Fabrice

Arseniy Alekseyev

unread,
Apr 29, 2016, 5:58:45 AM4/29/16
to ocaml...@googlegroups.com
You can try using [Async_extended.Process.create_fds].

If that doesn't work, you can try doing it with a combination of calls to [Core.Std.Unix.{fork,dup2,exec}].

--
You received this message because you are subscribed to the Google Groups "ocaml-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ocaml-core+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages