[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: svn commit: rev 4561 - trunk/subversion/clients/cmdline

From: <rbb_at_rkbloom.net>
Date: 2003-01-24 18:50:16 CET

On Fri, 24 Jan 2003, Bill Tutt wrote:

  From: Karl Fogel [mailto:kfogel@newton.ch.collab.net]
 
  cmpilato@tigris.org writes:
   Log:
   * subversion/clients/cmdline/cat-cmd.c
     (svn_client_cat): Finish Issue #1104. A poem by Bill Tutt
       billtut@microsoft.com.
 
  Lovely poem -- it's also nice to say something about what
  actually happened :-). The issue tracker is an adjunct to
  the logs, but not a replacement.
 
   + /* Grab an APR stdout I/O. */
   + status = apr_file_open_stdout (std_out, pool);
   + if (!APR_STATUS_IS_SUCCESS (status))
   + {
   + return svn_error_create (status, NULL, );
   + }
   +
      for (i = 0; i targets-nelts; i++)
        {
          const char *target = ((const char **) (targets-elts))[i];
   - svn_stream_t *out = svn_stream_from_stdio (stdout, pool);
   + svn_stream_t *out = svn_stream_from_aprfile (std_out, pool);
 
  A comment explaining why handle returned by
  apr_file_open_stdout() is preferable to the C library stdout
  would help a lot here. I'm guessing it's that the C stdout
  can't trusted to treat data as binary on all platforms,
  whereas the APR version can? But not sure about that...
 

 APR never uses stdio. Stdio (i.e. open, fopen, and fdopen) on Win32 is
 the only thing that cares about text vs. binary.

 Dunno about all APR platforms, but I hope this remains the case
 everywhere. If it isn't it's likely an APR bug.

I can shed some light on this. :-) The only reason that the
apr_file_open_std* functions exist is that you may not always have a
stderr/out/in on Windows. This is generally a problem with newer versions
of Windows and services.

The other problem is that the C library functions generally work
differently on Windows and Unix. So, by using apr_file_open_std*
functions, you can get a handle to an APR struct that works with the APR
functions which are supposed to work identically on all platforms.

Ryan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 14 02:14:12 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.