On Sat, 18 Dec 2010, Hyrum K. Wright wrote:
On Thu, Dec 16, 2010 at 11:18 AM, <cmpil...@apache.org> wrote:
Author: cmpilato
Date: Thu Dec 16 17:18:43 2010
New Revision: 1050061
URL: http://svn.apache.org/viewvc?rev=1050061&view=rev
Log:
Rev the svn_io_start_cmd() API, adding pipe support.
Modified: subversion/trunk/subversion/include/svn_io.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_io.h?rev=1050061&r1=1050060&r2=1050061&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_io.h (original)
+++ subversion/trunk/subversion/include/svn_io.h Thu Dec 16 17:18:43 2010
@@ -1484,9 +1484,17 @@ svn_io_dir_walk(const char *dirname,
/**
* Start @a cmd with @a args, using utf8-encoded @a path as working
- * directory. Connect @a cmd's stdin, stdout, and stderr to @a infile,
- * @a outfile, and @a errfile, except where they are NULL. Return the
- * process handle for the invoked program in @a *cmd_proc.
+ * directory. Return the process handle for the invoked program in @a
+ * *cmd_proc.
+ *
+ * If @a infile_pipe is TRUE, connect @a cmd's stdin to a pipe;
+ * otherwise, connect it to @a infile (which may be NULL). If
+ * @a outfile_pipe is TRUE, connect @a cmd's stdout to a pipe; otherwise,
+ * connect it to @a outfile (which may be NULL). If @a errfile_pipe
+ * is TRUE, connect @a cmd's stderr to a pipe; otherwise, connect it
+ * to @a errfile (which may be NULL). (Callers must pass FALSE for
+ * each of these boolean values for which the corresponding file
+ * handle is non-NULL.)
Innocent bystander question: if the *file_pipe arg is always FALSE
when the *file arg is non-NULL, is it always TRUE if the *file arg is
NULL? If so, can we use the NULL as the use-a-pipe sentinel, rather
than a separate arg?
No, there are 3 valid combinations:
- pipe=TRUE file=NULL: Create a pipe.
- pipe=FALSE file!=NULL: Use the file.
- pipe=FALSE file=NULL: Use stdin/stdout/stderr.
See also:
http://apr.apache.org/docs/apr/1.4/group__apr__thread__proc.html#g2b1598bc6f5ab0bfcf2e55096d563c98
- Martin