Index: main/trunk/greenstone2/runtime-src/src/recpt/os_process.cpp
===================================================================
--- main/trunk/greenstone2/runtime-src/src/recpt/os_process.cpp	(revision 22173)
+++ main/trunk/greenstone2/runtime-src/src/recpt/os_process.cpp	(revision 22173)
@@ -0,0 +1,67 @@
+/**********************************************************************
+ *
+ * os_process.cpp -- 
+ * Copyright (C) 2010  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+#include "os_process.h"
+
+osprocess::osprocess(char* cmd)
+{}
+osprocess::osprocess(char* cmdline, OSProcessPipeMode mode)
+  : mode_(mode)
+{}
+
+osprocess::~osprocess()
+{
+}
+  
+/*
+bool osprocess::eop()
+{
+}
+
+bool osprocess::eop(OSProcessPipeMode)
+{
+}
+*/
+
+int osprocess::read(char* buffer, const int buffer_len)
+{
+  return 0;
+}
+
+int osprocess::write(char* buffer, const int buffer_len)
+{
+  return 0;
+}
+  
+bool osprocess::close() 
+{
+  return true;
+}
+
+bool osprocess::close(OSProcessPipeMode mode)
+{
+  return true;
+}
+
Index: main/trunk/greenstone2/runtime-src/src/recpt/os_process.h
===================================================================
--- main/trunk/greenstone2/runtime-src/src/recpt/os_process.h	(revision 22173)
+++ main/trunk/greenstone2/runtime-src/src/recpt/os_process.h	(revision 22173)
@@ -0,0 +1,66 @@
+/**********************************************************************
+ *
+ * os_process.h -- base class for OS specific calls related to creating 
+ *                 process *without* (in the case of Windows) opening a 
+ *                 DOS window.  
+ *
+ *                 Nett effect is OS neutral way to support
+ *                 popen() and related functions
+ *
+ * Copyright (C) 2010  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+#ifndef OS_PROCESS_H
+#define OS_PROCESS_H
+
+ #include <stdlib.h>
+
+enum OSProcessPipeMode { uniRead=0, uniWrite=1, biReadWrite=2, noPipe=3 };
+
+class osprocess 
+{
+  
+ public:
+  osprocess(char* cmdline);
+  osprocess(char* cmdline, OSProcessPipeMode mode);
+  virtual ~osprocess();
+  
+  /*
+  virtual bool eop();                  // end of pipe
+  virtual bool eop(OSProcessPipeMode); // end of pipe, for designated pipe
+  */
+
+  virtual int write(char* buffer, const int buffer_len);
+  virtual int read(char* buffer, const int buffer_len);
+  
+  virtual bool close();
+  virtual bool close(OSProcessPipeMode mode);
+  
+ protected:
+  OSProcessPipeMode mode_;
+  bool read_pipe_open_;
+  bool write_pipe_open_;
+
+};
+
+#endif
+
Index: main/trunk/greenstone2/runtime-src/src/recpt/os_process_unix.cpp
===================================================================
--- main/trunk/greenstone2/runtime-src/src/recpt/os_process_unix.cpp	(revision 22173)
+++ main/trunk/greenstone2/runtime-src/src/recpt/os_process_unix.cpp	(revision 22173)
@@ -0,0 +1,234 @@
+/**********************************************************************
+ *
+ * os_process_unix.cpp -- Unix version of osprocess.  See os_process.h
+ *                 for more details
+ *
+ * Copyright (C) 2010  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+#ifndef __WIN32__ // i.e Unix
+
+#if defined(GSDL_USE_OBJECTSPACE)
+#  include <ospace/std/iostream>
+#elif defined(GSDL_USE_IOS_H)
+#  include <iostream.h>
+#else
+#  include <iostream>
+using namespace std;
+#endif
+
+#include <unistd.h>
+
+#include "os_process_unix.h"
+
+#define READ_PIPE_INDEX 0
+#define WRITE_PIPE_INDEX 1
+
+
+osprocessunix::osprocessunix(char* cmdline)
+  : osprocess(cmdline)
+{}
+
+osprocessunix::osprocessunix(char* cmdline, OSProcessPipeMode mode)
+  : child_stdout_read_(NULL), child_stdin_write_(NULL),
+    osprocess(cmdline,mode)
+{
+  
+  // Create a pipe for the child process's STDOUT. 
+  int stdout_pipe_fd[2];
+
+  if (pipe(stdout_pipe_fd)!=0) {
+    cerr << "osprocessunix::osprocessunix(): Failed to create stdout pipe for child process" << endl; 
+    return;
+  }
+
+  child_stdout_read_ = stdout_pipe_fd[READ_PIPE_INDEX];
+  int child_stdout_write = stdout_pipe_fd[WRITE_PIPE_INDEX];
+  
+
+  // Create a pipe for the child process's STDIN. 
+  int stdin_pipe_fd[2];
+
+  if (pipe(stdin_pipe_fd)!=0) {
+    cerr << "osprocessunix::osprocessunix(): Failed to create stdin pipe for child process" << endl; 
+    return;
+  }
+
+  int child_stdin_read = stdin_pipe_fd[READ_PIPE_INDEX];
+  child_stdin_write_ = stdin_pipe_fd[WRITE_PIPE_INDEX];
+
+  
+  pid_t pid = fork();
+  if (pid < 0) {
+    cerr << "osprocessunix::osprocessunix(): Failed to create child process" << endl; 
+    return;
+  }
+
+  if (pid == 0) {
+    // Child process
+
+    // Sort out input pipe
+    //   child has no buisness accessing write end of input pipe => close
+    close(child_stdin_write_);   
+
+    if ((mode == uniWrite) || (mode == biReadWrite)) {
+      //   wire up child's stdin read so its input comes from the parent's pipe
+      dup2(child_stdin_read, FD_STDIN); 
+    }
+    else {
+      // noPipe or (parent is doing) uniRead (which means we're not interested
+      // in the child reading any input from the parent)
+      // => child input remains coming from stdin
+      close(child_stdin_read);
+    }
+
+    // Sort out output pipe
+    //   child has no buisness accessing read end of output pipe => close
+    close(child_stdout_read_);
+    if ((mode == uniRead) || (mode == biReadWrite)) {
+      //   wire up child's stdout write so it is send down the pipe to the parent
+      dup2(child_stdout_write, FD_STDOUT); 
+    }
+    else {
+      // noPipe or (parent is doing) uniWrite (which means we're not interested
+      // in any output produced by the child process)
+      // => child output remains going to stdout
+      close(child_stdout_write);
+    }
+
+    // execve ...
+    int rv = CreateProcess(NULL,    // no application name
+			   cmdline, 
+			   NULL, 
+			   NULL,    // no process or thread security attribues 
+			   TRUE,    // Inherit handles
+			   0,       // Creation flag
+			   NULL,    // No environment block
+			   ".",     // current working directory
+			   &si, 
+			   &pi_);    // process info filled out as a result
+    if (!rv) {
+      fprintf(stderr,"os_process_windows(): Error creating process");
+    }
+    
+  }
+  else {
+    // Parent process
+
+    // Sort out input pipe
+    //    parent has no buisness accessing read end of input pipe => close
+    close(child_stdin_read);
+
+    // Sort out output pipe
+    //    parent has no buisness accessing write end of output pipe => close
+    close(child_stdout_write);
+
+
+    switch(mode) 
+    {
+      case uniRead:
+	close(child_stdin_write_);
+	break;
+      case uniWrite:
+	close(child_stdout_read_);
+	break;
+      case biReadWrite:
+	// nothing to do
+	// the pipes are set up just the way we want them
+	break;
+      case noPipe:
+	close(child_stdin_write_);
+	close(child_stdout_read_);
+	break;
+    }
+  }
+}
+
+osprocessunix::~osprocessunix()
+{}
+
+/*  
+bool osprocessunix::eop()
+{}
+
+bool osprocessunix::eop(OSProcessPipeMode)
+{}
+*/
+
+int osprocessunix::write(char* buffer, const int buffer_len)
+{
+
+  int actual_write_len = write(child_stdin_write_, buffer, buffer_len);
+  
+  if (data_written<0) {
+    cerr << "osproessunix::write() Error: failed to write data" << endl;
+  }
+
+  return actual_write_len;
+}
+
+int osprocessunix::read(char* buffer, const int buffer_len)
+{
+  int actual_read_len = read(child_stdout_read_, buffer, buffer_len);
+
+  if (actual_read_len<0) {
+    cerr << "osproessunix::read() Error: failed to read data" << endl;
+  }
+
+  return actual_read_len;
+}
+
+
+  
+bool osprocessunix::close()
+{}
+
+bool osprocessunix::close(OSProcessPipeMode mode)
+{}
+
+
+int main()  {
+ int  pipe_fd[2];
+ pipe(pipe_fd);
+
+ if (fork() == 0)  {                     /* create child process          */
+  char *av[3] = { "ls", "-c1", 0};       /* parameters for command        */ 
+  close(pipe_fd[0]);                     /* close read end of pipe        */  
+  close(1);                              /* close standard output         */
+  dup(pipe_fd[1]);                       /* attach write end of pipe      */
+                                         /* stdout is lowest available fd */ 
+  execve("/bin/ls", av, 0);              /* run the ls code               */
+ }
+ else  {                                 /* in the parent process         */
+  int files;
+  char ch;
+  close(pipe_fd[1]);                     /* close write end of pipe       */
+  files = 0;                             /* counter for number of files   */
+        
+  while ( 0 != read(pipe_fd[0], &ch, 1) )/* read from pipe until eof      */
+   if (ch == '\n')                       /* each newline represents a file*/
+    ++files;        
+   cout<< "There are " << files << " files\n";
+  }
+}
+
+#endif
Index: main/trunk/greenstone2/runtime-src/src/recpt/os_process_unix.h
===================================================================
--- main/trunk/greenstone2/runtime-src/src/recpt/os_process_unix.h	(revision 22173)
+++ main/trunk/greenstone2/runtime-src/src/recpt/os_process_unix.h	(revision 22173)
@@ -0,0 +1,61 @@
+/**********************************************************************
+ *
+ * os_process_unix.h -- Unix version of osprocess.  See os_process.h
+ *                 for more details
+ *
+ * Copyright (C) 2010  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+
+#ifndef OS_PROCESS_UNIX_H
+#define OS_PROCESS_UNIX_H
+
+#ifndef __WIN32__ // i.e. Unix
+
+#include "os_process.h"
+
+class osprocessunix : osprocess
+{
+   
+ public:
+  osprocessunix(const char* cmd);
+  osprocessunix(const char* cmd, const OSProcessPipeMode mode);
+  virutal ~osprocessunix();
+  
+  virtual eop();                  // end of pipe
+  virtual eop(OSProcessPipeMode); // end of pipe, for named pipe
+
+  virtual int read(char* buffer, const int buffer_len);
+  virtual bool write(char* buffer, const int buffer_len);
+  
+  virtual bool close();
+  virtual bool close(OSProcessPipeMode mode);
+
+ protected:
+  File* read_fd_;
+  File* write_fd_;
+};
+
+#endif
+
+#endif
+
Index: main/trunk/greenstone2/runtime-src/src/recpt/os_process_windows.cpp
===================================================================
--- main/trunk/greenstone2/runtime-src/src/recpt/os_process_windows.cpp	(revision 22173)
+++ main/trunk/greenstone2/runtime-src/src/recpt/os_process_windows.cpp	(revision 22173)
@@ -0,0 +1,250 @@
+/**********************************************************************
+ *
+ * os_process_windows.c -- Windows version of osprocess.  See os_process.h
+ *                         for more details
+ *
+ * Copyright (C) 2010  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+#ifdef __WIN32__
+
+#if defined(GSDL_USE_OBJECTSPACE)
+#  include <ospace/std/iostream>
+#elif defined(GSDL_USE_IOS_H)
+#  include <iostream.h>
+#else
+#  include <iostream>
+using namespace std;
+#endif
+
+#include "os_process_windows.h"
+
+//#include <stdio.h>
+
+osprocesswindows::osprocesswindows(char* cmdline)
+  : osprocess(cmdline)
+{}
+
+osprocesswindows::osprocesswindows(char* cmdline, OSProcessPipeMode mode)
+  : child_stdout_read_(NULL), child_stdin_write_(NULL),
+    osprocess(cmdline,mode)
+{
+  HANDLE child_stdin_read = NULL;
+  HANDLE child_stdout_write = NULL;
+
+  SECURITY_ATTRIBUTES saAttr; 
+  saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); 
+  saAttr.bInheritHandle = TRUE; 
+  saAttr.lpSecurityDescriptor = NULL; 
+  
+  // Create a pipe for the child process's STDOUT. 
+  if (!CreatePipe(&child_stdout_read_, &child_stdout_write, &saAttr, 0)) {
+    cerr << "osprocesswindows::osprocesswindows(): Failed to create stdout pipe for child process" << endl; 
+  }
+  
+  // Ensure the read handle to the pipe for STDOUT is not inherited.
+  if (!SetHandleInformation(child_stdout_read_, HANDLE_FLAG_INHERIT, 0)) {
+    cerr << "osprocesswindows::osprocesswindows(): Failed to set handle information for stdout pipe for child process" << endl;
+  }
+  
+  // Create a pipe for the child process's STDIN. 
+  if (!CreatePipe(&child_stdin_read, &child_stdin_write_, &saAttr, 0)) {
+    cerr << "osprocesswindows::osprocesswindows(): Failed to create stdin pipe for child process" << endl;
+  }
+  
+  // Ensure the write handle to the pipe for STDIN is not inherited. 
+  if (!SetHandleInformation(child_stdin_write_, HANDLE_FLAG_INHERIT, 0)) {
+    cerr << "osprocesswindows::osprocesswindows(): Failed to set handle information for stdin pipe for child process" << endl;
+  }
+  
+  STARTUPINFOA si;
+  memset(&si, 0, sizeof(si));
+  memset(&pi_, 0, sizeof(pi_));
+  
+  si.cb = sizeof(si);
+  
+  // These two lines help prevent a DOS window popping up
+  // when the process is created
+  si.dwFlags |= STARTF_USESHOWWINDOW;
+  si.wShowWindow = SW_HIDE;
+  
+  si.dwFlags |= STARTF_USESTDHANDLES;
+  
+  // any error messages in child process to to same place as parent process
+  // e.g. in the case of running as a CGI script, the Web server error log
+  si.hStdError  = GetStdHandle(STD_ERROR_HANDLE); 
+  
+  // Output from the child process comes to the parent process, down the
+  // OUT pipe
+  si.hStdOutput = child_stdout_write;
+  
+  // Input to the child process can be sent from the parent process, down the
+  // In pipe
+  si.hStdInput = child_stdin_read;
+  
+  int rv = CreateProcess(NULL,    // no application name
+			 cmdline, 
+			 NULL, 
+			 NULL,    // no process or thread security attribues 
+			 TRUE,    // Inherit handles
+			 0,       // Creation flag
+			 NULL,    // No environment block
+			 ".",     // current working directory
+			 &si, 
+			 &pi_);    // process info filled out as a result
+  if (!rv) {
+    cerr << "os_process_windows(): Error creating process" << endl;
+  }
+
+  // close the handles that aren't used by the parent process
+
+  if (!CloseHandle(child_stdout_write)) {
+    cerr <<  "os_process_windows(): Error closing StdOutWr Handle" << endl;
+  }
+
+  if (!CloseHandle(child_stdin_read)) {
+    cerr << "os_process_windows(): Error closing StdInRd Handle" << endl;
+  }
+}  
+  
+
+osprocesswindows::~osprocesswindows() 
+{
+  // Close process and thread handles
+  CloseHandle( pi_.hProcess );  
+  pi_.hProcess = NULL;
+  
+  CloseHandle( pi_.hThread );   
+  pi_.hThread = NULL;
+}
+
+
+/*
+bool osprocesswindows::eop()
+{
+}
+
+bool osprocesswindows::eop(OSProcessPipeMode)
+{
+}
+*/
+
+
+
+int osprocesswindows::write(const char* buffer, const int buffer_len) 
+{ 
+  DWORD actual_write_len;
+  
+  bool write_ok 
+    = WriteFile(child_stdin_write_, buffer, buffer_len, &actual_write_len, NULL);
+  if (!write_ok) {
+    cerr << "osproesswindows::write() Error: failed to write data" << endl;
+  }
+  return actual_write_len;
+} 
+
+
+int osprocesswindows::read(char* buffer, const int buffer_len) 
+{ 
+  DWORD actual_read_len;
+  
+  bool read_ok 
+    = ReadFile(child_stdout_read_, buffer, buffer_len, &actual_read_len, NULL);
+  if (!read_ok) {
+    cerr << "osproesswindows::read() Error: failed to read data" << endl;
+  }
+
+  return actual_read_len;
+}
+
+
+bool osprocesswindows::close() {
+  return true;
+}
+
+bool osprocesswindows::close(OSProcessPipeMode mode) 
+{
+  // Close the pipe handle so the child process stops reading. 
+  
+  if (!CloseHandle(child_stdin_write_)) {
+    cerr << "osprocesswindows::close(): Failed to close stdin write handle on pipe to child process" << endl;
+    return false;
+  }
+
+  if (!CloseHandle(child_stdout_read_)) {
+    cerr << "osprocesswindows::close(): Failed to close handle stdout read on pipe to chlild process" << endl;
+    return false;
+  }
+
+
+  return true;
+}
+
+
+
+
+
+//#ifdef TEST_OS_PROCESS_WINDOWS
+#if 0
+
+int main ()
+{
+  char* input_line = NULL;
+  char* prog_name = "c:\\Windows\\system32\\java.exe";
+  char* cmd_line = "java";
+  
+  //char* input_line = "echo hi there\n";
+  //char* prog_name  = "c:\\cygwin\\bin\\cat.exe";
+  //char* cmd_line   = "cat";
+
+  osprocesswindows osprocess(cmd_line,uniRead);
+
+  printf("Content-type: text/html\n\n");
+  
+  printf( "<html>\n");
+  printf( "  <head>\n");
+  printf( "    <title>Testing</title>\n");
+  printf( "  </head>\n");
+  printf( "  <body>\n");
+  
+
+  const int BufferSize = 1024;
+  char buffer[BufferSize];
+
+  int bytes_read = 0;
+  do {
+    bytes_read = osprocess.read(buffer,BufferSize);
+    if (bytes_read>0) {
+      fwrite(buffer,1,bytes_read,stdout);
+    }
+  } while (bytes_read==BufferSize);
+
+
+  printf( "  </body>\n");
+  printf( "</html>\n");
+  
+  return 0;
+}
+
+#endif
+
+#endif
Index: main/trunk/greenstone2/runtime-src/src/recpt/os_process_windows.h
===================================================================
--- main/trunk/greenstone2/runtime-src/src/recpt/os_process_windows.h	(revision 22173)
+++ main/trunk/greenstone2/runtime-src/src/recpt/os_process_windows.h	(revision 22173)
@@ -0,0 +1,64 @@
+/**********************************************************************
+ *
+ * os_process_windows.h -- Windows version of osprocess.  See os_process.h
+ *                         for more details
+ *
+ * Copyright (C) 2010  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+#ifndef OS_PROCESS_WINDOWS_H
+#define OS_PROCESS_WINDOWS_H
+
+#ifdef __WIN32__
+
+#include "os_process.h"
+
+#include <windows.h> 
+
+class osprocesswindows : osprocess
+{
+public:
+  osprocesswindows(char* cmdline);
+  osprocesswindows(char* cmdline, OSProcessPipeMode mode);
+  virtual ~osprocesswindows();
+
+  /*
+  virtual bool eop();                  // end of pipe
+  virtual bool eop(OSProcessPipeMode); // end of pipe, for designated pipe
+  */
+
+  virtual int read(char* buffer, const int buffer_len);
+  virtual int write(const char* buffer, const int buffer_len);
+
+  virtual bool close();
+  virtual bool close(OSProcessPipeMode mode);
+
+protected:
+  PROCESS_INFORMATION pi_;
+
+  HANDLE child_stdin_write_;
+  HANDLE child_stdout_read_;
+};
+
+#endif
+
+#endif
