From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 2EC8E46970F for ; Thu, 28 Nov 2019 23:45:28 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id s22so10692567ljs.7 for ; Thu, 28 Nov 2019 12:45:28 -0800 (PST) From: Cyrill Gorcunov Date: Thu, 28 Nov 2019 23:45:07 +0300 Message-Id: <20191128204512.19732-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 0/5] popen: Add ability to run external process List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml In this series we provide a way to execute external binaries from inside of Lua scripts, control children process and communicate with their stdin/out/err streams. The series is preliminary since there are known issues I have to resolve before merging. Still to share code early I decided to post them even in such shape. While I'm more-less sure about stability of the engine itself (which lays in src/lib/core/popen.c) the lua interface which sits in src/lua/fio.lua looks not that convenient I think. All created popen objects require explicit popen:close call probably I should hook up lua GC (as I being advised). Anyway please take a look once time permit. Any comments are highly appreciated. All patches are sitting in branch gorcunov/gh-4031-popen Cyrill Gorcunov (5): popen: Introduce a backend engine lua/fio: Add lbox_fio_push_error as a separate helper popen/fio: Merge popen engine into fio internal module popen/fio: Implement lua interface for a popen object test: Add app/popen test src/lib/core/CMakeLists.txt | 1 + src/lib/core/coio_file.c | 155 +++++ src/lib/core/coio_file.h | 10 + src/lib/core/popen.c | 1204 +++++++++++++++++++++++++++++++++++ src/lib/core/popen.h | 135 ++++ src/lua/fio.c | 250 +++++++- src/lua/fio.lua | 434 +++++++++++++ src/main.cc | 4 + test/app/popen.result | 105 +++ test/app/popen.test.lua | 39 ++ 10 files changed, 2333 insertions(+), 4 deletions(-) create mode 100644 src/lib/core/popen.c create mode 100644 src/lib/core/popen.h create mode 100644 test/app/popen.result create mode 100644 test/app/popen.test.lua -- 2.20.1