add command to manually close input pipe (send CTRL-D / EOF)
authorAndreas Frisch <andreas.frisch@multimedia-labs.de>
Sun, 19 Oct 2008 20:20:41 +0000 (20:20 +0000)
committerAndreas Frisch <andreas.frisch@multimedia-labs.de>
Sun, 19 Oct 2008 20:20:41 +0000 (20:20 +0000)
lib/base/console.cpp
lib/base/console.h

index 6dc21d2..3dfcbae 100644 (file)
@@ -268,6 +268,17 @@ void eConsoleAppContainer::sendCtrlC()
        }
 }
 
+void eConsoleAppContainer::sendEOF()
+{
+       if (out)
+               out->stop();
+       if (fd[1] != -1)
+       {
+               ::close(fd[1]);
+               fd[1]=-1;
+       }
+}
+
 void eConsoleAppContainer::closePipes()
 {
        if (in)
index f7cd469..e6c6176 100644 (file)
@@ -45,6 +45,7 @@ public:
        int getPID() { return pid; }
        void kill();
        void sendCtrlC();
+       void sendEOF();
        void write( const char *data, int len );
        void write( PyObject *data );
        void readFromFile( PyObject *py_filename );