Re: copy_file_preserving variant that doesn't exit on error?

2012-01-12 Thread Reuben Thomas
On 12 January 2012 15:40, Bruno Haible wrote: > Hi Reuben, > >> so where's the test with /dev/null? > > You didn't submit a test with /dev/null. If it makes sense to have one, > please submit one. Ah, I think I tried to make one, but it didn't make sense, because I was trying to make a file that

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-12 Thread Bruno Haible
Hi Reuben, > so where's the test with /dev/null? You didn't submit a test with /dev/null. If it makes sense to have one, please submit one. Bruno

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-12 Thread Reuben Thomas
On 12 January 2012 13:26, Bruno Haible wrote: > Hi Reuben, > > Reuben Thomas wrote: >> I find no tests for specific return codes from qcopy_file_preserving (grep >> GL_COPY gives no hits in gnulib/tests/), and I can find no test >> involving /dev/null (all instances I can find are redirections, no

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-12 Thread Bruno Haible
Hi Reuben, Reuben Thomas wrote: > I find no tests for specific return codes from qcopy_file_preserving (grep > GL_COPY gives no hits in gnulib/tests/), and I can find no test > involving /dev/null (all instances I can find are redirections, not > parameters to a test). Yes, I added a test for whe

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-12 Thread Reuben Thomas
On 12 January 2012 12:55, Jim Meyering wrote: > Reuben Thomas wrote: > >> On 12 January 2012 02:13, Bruno Haible wrote: >>> >>> - In copy-file.h declare the right function name. >> >> Ah yes, I must've missed warnings for this, sorry. >> >>> - In the tests I also had to drop the test with /dev/fu

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-12 Thread Jim Meyering
Reuben Thomas wrote: > On 12 January 2012 02:13, Bruno Haible wrote: >> >> - In copy-file.h declare the right function name. > > Ah yes, I must've missed warnings for this, sorry. > >> - In the tests I also had to drop the test with /dev/full, since - unlike >>  /dev/null - this device does not e

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-12 Thread Reuben Thomas
On 12 January 2012 02:13, Bruno Haible wrote: > > - In copy-file.h declare the right function name. Ah yes, I must've missed warnings for this, sorry. > - In the tests I also had to drop the test with /dev/full, since - unlike >  /dev/null - this device does not exist everywhere. Ex.: on OpenBSD

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-11 Thread Bruno Haible
Reuben Thomas wrote: > > errno describes _what_ error occurred. The error message also contains > > information about _when_ it occurred. > > Actually, the error codes returned by qcopy_file_preserving contain > all the information about when the error occurred, as you can see in > copy_file_prese

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-11 Thread Bruno Haible
Hi Reuben, I've added your patch, with a couple of modifications: - After the refactoring that calls qcopy_acl rather than copy_acl, two error messages are possible instead of one. Added one more GL_COPY_ERR_* value. - In copy-file.h declare the right function name. - In the tests I don't fin

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-11 Thread Reuben Thomas
On 11 January 2012 01:32, Bruno Haible wrote: > > errno describes _what_ error occurred. The error message also contains > information about _when_ it occurred. Actually, the error codes returned by qcopy_file_preserving contain all the information about when the error occurred, as you can see in

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-10 Thread Bruno Haible
Hi Reuben, > >> Is there no way to deal with error messages normally, i.e. via > >> gnulib's strerror? Then the error-returning copy_file_preserving could > >> replace the aborting version, and users who want to could check the > >> return code and issue errors in the usual way. > > > > This would

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-10 Thread Reuben Thomas
On 11 January 2012 00:28, Bruno Haible wrote: > > - But actually the function copy_file_preserving_error is equivalent to >  _copy_file_preserving. So why not just rename _copy_file_preserving >  to copy_file_preserving_error and ditch the one-line wrapper? Done. > - About the naming of the func

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-10 Thread Bruno Haible
Hi Reuben, Thanks for working on this refactoring. Reuben Thomas wrote: > Here's a revised version of my patch. A couple of comments. Yes I heard that it's not so much fun to hear picky comments, but quality... - The function _copy_file_preserving is not declared nor used outside that file. H

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-10 Thread Reuben Thomas
Here's a revised version of my patch. Is there no way to deal with error messages normally, i.e. via gnulib's strerror? Then the error-returning copy_file_preserving could replace the aborting version, and users who want to could check the return code and issue errors in the usual way. If that's

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-10 Thread Reuben Thomas
On 10 January 2012 09:16, Jim Meyering wrote: > A couple of suggestions: Thanks for the review. >  ERR_READ may be too generic, risking collision with symbols defined by >  other applications.  Perhaps names like GL_COPY_READ_FAILURE, >  GL_ACL_PRESERVE_FAILURE, etc. I now have GL_COPY_ERR_*. I

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-10 Thread Jim Meyering
Reuben Thomas wrote: > Ping! I've not heard anything about this; my current patch (as used in > GNU Zile) still seems to work. Hi Reuben, Thanks for the reminder. A couple of suggestions: ERR_READ may be too generic, risking collision with symbols defined by other applications. Perhaps name

Re: copy_file_preserving variant that doesn't exit on error?

2012-01-09 Thread Reuben Thomas
Ping! I've not heard anything about this; my current patch (as used in GNU Zile) still seems to work. On 2 August 2011 18:31, Reuben Thomas wrote: > Here's a revised patch to provide error returning copy-file as well as > error-raising copy-file. > > Of particular interest: > > 1. What would you

Re: copy_file_preserving variant that doesn't exit on error?

2011-08-02 Thread Reuben Thomas
Here's a revised patch to provide error returning copy-file as well as error-raising copy-file. Of particular interest: 1. What would you like to call the new function? 2. I haven't yet added a test; from looking at the tests for copy-file it seems it should suffice to add a call to remove follo

Re: copy_file_preserving variant that doesn't exit on error?

2011-08-02 Thread Reuben Thomas
On 2 August 2011 09:21, Jim Meyering wrote: > > Ideally, copy_file_preserving would retain it semantics > and it would simply call your new function (containing the > guts of this one), obtain an indication of which part (if any) > failed, and then diagnose and exit. > > As you can see, there will

Re: copy_file_preserving variant that doesn't exit on error?

2011-08-02 Thread Jim Meyering
Reuben Thomas wrote: > By the way, I note that the return value of chown is ignored where no > other return value is; is this an oversight, or is it really the case > that this is the one operation whose failure can be overlooked? I think the rationalization is that depending on the type of the d

Re: copy_file_preserving variant that doesn't exit on error?

2011-08-02 Thread Jim Meyering
Reuben Thomas wrote: > On 24 July 2011 21:05, Reuben Thomas wrote: >> I just came across the copy-file module, which does exactly what I >> want (it is even geared to making backup files), but (unfortunately >> for use in an interactive program) exits on error. > > Just to move this along a bit, I

Re: copy_file_preserving variant that doesn't exit on error?

2011-08-01 Thread Reuben Thomas
By the way, I note that the return value of chown is ignored where no other return value is; is this an oversight, or is it really the case that this is the one operation whose failure can be overlooked?

Re: copy_file_preserving variant that doesn't exit on error?

2011-08-01 Thread Reuben Thomas
On 24 July 2011 21:05, Reuben Thomas wrote: > I just came across the copy-file module, which does exactly what I > want (it is even geared to making backup files), but (unfortunately > for use in an interactive program) exits on error. Just to move this along a bit, I attach a patch which changes

copy_file_preserving variant that doesn't exit on error?

2011-07-24 Thread Reuben Thomas
I just came across the copy-file module, which does exactly what I want (it is even geared to making backup files), but (unfortunately for use in an interactive program) exits on error. I was just wondering what the rationale for this is, rather than returning an error code. Even in a non-interact