bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eric Blake
Subject: bug#7775: rm -f emits no error message when deleting nonexistent file
Date: Mon, 03 Jan 2011 10:00:21 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

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   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]