GNU bug report logs - #11816
sort -o: error comes late if opening the outfile fails

Previous Next

Package: coreutils;

Reported by: Bernhard Voelker <mail <at> bernhard-voelker.de>

Date: Fri, 29 Jun 2012 12:00:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jim Meyering <jim <at> meyering.net>
To: 11816 <at> debbugs.gnu.org
Cc: P <at> draigBrady.com
Subject: bug#11816: sort -o: error comes late if opening the outfile fails
Date: Mon, 02 Jul 2012 13:26:46 +0200
Pádraig Brady wrote:
...
> Subject: [PATCH] sort: avoid redundant processing with inaccessible inputs or
>  output
>
> * src/sort.c (check_inputs): A new function to verify all inputs
> are accessible before further processing.
> (check_output): A new function to open or create a specified
> output file, before futher processing.
> (stream_open): Adjust to truncating the previously opened
> output file rather than opening directly.
> (avoid_trashing_input): Optimize to stat the output file
> descriptor, rather than the file name.
> (main): Call the new functions to check accessability of

Hi Pádraig,

Thanks for dealing with this.
So far, I've read through the commit log and NEWS:

s/accessability/accessibility/

> inputs and output, before processing starts.
...
> diff --git a/NEWS b/NEWS
> index 8c75a32..c51fb78 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -41,6 +41,12 @@ GNU coreutils NEWS                                    -*- outline -*-
>    patches as well as enough support to build on the Hurd, we no longer
>    have any reason to include it here.
>
> +** Improvements
> +
> +  sort will avoid redundant processing in the presence of inaccessible inputs,

s/will avoid/avoids/ (or "now avoids") ?

> +  or unwritable output.  Immediate errors are now given before any potentially
> +  expensive processing is initiated.

Maybe replace that "Immediate ..." sentence with something like this:

  Sort now diagnoses certain errors at start-up, rather than
  only after potentially expensive processing.




This bug report was last modified 12 years and 324 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.