Subject: Re: bug#7775: rm -f emits no error message when deleting nonexistent file

From: Eric Blake <[email-masked]>
Date: Mon, 03 Jan 2011 10:00:21 -0700

On 01/03/2011 08:12 AM, Jeremy Hetzler wrote:
> rm normally produces an error when you delete a nonexistent file. However,
> under -f, you get no error message. I would argue this is a bug.

Thanks for the report; however, this behavior is by design, and required
by POSIX:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html

> 1. If the file does not exist:
> 
>    a. If the -f option is not specified, rm shall write a diagnostic message to standard error.
>    b. Go on to any remaining files.

That is, the whole point of -f is to silence warnings, including
warnings about non-existent files.

-- 
Eric Blake   [email-masked]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org