Subject: Re: bug#17470: [PATCH] sort: rotate on ENOSPC while creating tmp files

From: Paul Eggert <[email-masked]>
Date: Wed, 14 May 2014 07:48:39 -0700

Pádraig Brady wrote:
> Also do we always know how much to fallocate?

Not if we're using compression on the temporaries, no.

I think a patch along these lines could be worthwhile, if it was simple 
and if it actually worked (the current one doesn't).  Something along 
the following lines, say.  When multiple -T options are specified (-T 
FOO, -T FOP, -T FOQ, ...) and one of them runs out of disk space when 
creating a temporary file FOO/BAR, 'sort' stops creating files in FOO 
(effectively removing FOO from the option list) creates a file FOP/BAR 
instead, and redoes the process (whatever it was) that sent output to 
FOO/BAR, sending the output to FOP/BAR this time.

I don't have the energy right now to write that, but if someone else 
wrote it I'd review it.