Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh: RM_STAR warning counts files as though DOT_GLOB is set



On Mon, Sep 11, 2017 at 8:23 AM, Peter Stephenson
<p.stephenson@xxxxxxxxxxx> wrote:
> On Mon, 11 Sep 2017 15:19:15 +0000
> Daniel Shahaf <danielsh@xxxxxxxxxx> wrote:
>> I don't understand the last branch of the if/else in that function: it
>> seems to prompt "... delete all the files ..." when count == 0?
>
> Apparently, yes.  I think it's just covering the bases.

The issue here, as I recall, is that it's possible to have:
1 "rm *" is issued
2 chkrmall() finds no files in the directory
3 some external process creates a file
4 "rm *" is executed
5 the file created at (3) is silently deleted

So we would need either to avoid re-expanding "*" after chkrmall(), or
treat "found no files" as "user answered no".



Messages sorted by: Reverse Date, Date, Thread, Author