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 6dc21d2ecf99be30a191b3e16d6a7b6c501546e5..3dfcbae8ebc7d29220d57e8e622bccaf003b44c4 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)
 void eConsoleAppContainer::closePipes()
 {
        if (in)
index f7cd469ca19de6918be232e4d1dd902805fd5af1..e6c61766541ae49579377c0ebea5a940406a434b 100644 (file)
@@ -45,6 +45,7 @@ public:
        int getPID() { return pid; }
        void kill();
        void sendCtrlC();
        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 );
        void write( const char *data, int len );
        void write( PyObject *data );
        void readFromFile( PyObject *py_filename );