Index: src/OFProcess.h ================================================================== --- src/OFProcess.h +++ src/OFProcess.h @@ -56,6 +56,15 @@ * \return An initialized OFProcess. */ - initWithProgram: (OFString*)program programName: (OFString*)programName arguments: (OFArray*)arguments; + +/** + * \brief Closes the write direction of the process. + * + * This method needs to be called for some programs before data can be read, + * since some programs don't start processing before the write direction is + * closed. + */ +- (void)closeForWriting; @end Index: src/OFProcess.m ================================================================== --- src/OFProcess.m +++ src/OFProcess.m @@ -136,10 +136,18 @@ /* * FIXME: Add -[fileDescriptor]. The problem is that we have two FDs, which is * not yet supported by OFStreamObserver. This has to be split into one * FD for reading and one for writing. */ + +- (void)closeForWriting +{ + if (writePipe[1] != -1) + close(writePipe[1]); + + writePipe[1] = -1; +} - (void)close { if (readPipe[0] != -1) close(readPipe[0]);