From unknown Sun Aug 17 02:00:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7775: rm -f emits no error message when deleting nonexistent file Resent-From: Jeremy Hetzler Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 03 Jan 2011 15:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7775 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 7775@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.129407007628204 (code B ref -1); Mon, 03 Jan 2011 15:55:01 +0000 Received: (at submit) by debbugs.gnu.org; 3 Jan 2011 15:54:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZmk0-0007Kq-7p for submit@debbugs.gnu.org; Mon, 03 Jan 2011 10:54:36 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZlyi-0006E3-7C for submit@debbugs.gnu.org; Mon, 03 Jan 2011 10:05:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZm5a-0001jJ-3Q for submit@debbugs.gnu.org; Mon, 03 Jan 2011 10:12:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:60286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZm5a-0001jF-17 for submit@debbugs.gnu.org; Mon, 03 Jan 2011 10:12:50 -0500 Received: from [140.186.70.92] (port=46001 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZm5Z-0002Tj-21 for bug-coreutils@gnu.org; Mon, 03 Jan 2011 10:12:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZm5Y-0001ip-1j for bug-coreutils@gnu.org; Mon, 03 Jan 2011 10:12:48 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:42463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZm5X-0001ie-Tu for bug-coreutils@gnu.org; Mon, 03 Jan 2011 10:12:48 -0500 Received: by wyj26 with SMTP id 26so13978021wyj.0 for ; Mon, 03 Jan 2011 07:12:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=WhX+3f8miQUffxu8wQmRR/z67JP2IIr//jLflrKbxDQ=; b=DrXmy4IH+iGOpFw4sL4fkuEn3h4fZrZW9dc/3n608EC/Dmp6I9Qha3477hTN837lDV +gFwX5RPov+RsSjp5PqAnq1A4PAXrkRlIZa/z2mDHCAZlOU+j3rtVJMgu3dTEFE6opq4 eCh0pv7hMnLxc4cQeAioudL34BUFnm2141L3g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=X1sgriis9inZj3A4iwyY5+7J3qUFmRfGlsjhweoqNpVIphNHpI6x/oOMqRwU34jLYL kfjaLVQtLsd1dMJo4fnpGbq9QnCsszwI6xO8Nxo+boZn2qTSj4/IEpkhS4vPG4/l/3RL E78O1HiRxcjbmmnwSB2+G/Zm437TY/Nu1H+og= Received: by 10.227.146.133 with SMTP id h5mr11588179wbv.42.1294067566525; Mon, 03 Jan 2011 07:12:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.138.12 with HTTP; Mon, 3 Jan 2011 07:12:26 -0800 (PST) From: Jeremy Hetzler Date: Mon, 3 Jan 2011 10:12:26 -0500 Message-ID: Content-Type: multipart/alternative; boundary=0016e647160c9e3c150498f29572 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Mon, 03 Jan 2011 10:54:35 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --0016e647160c9e3c150498f29572 Content-Type: text/plain; charset=ISO-8859-1 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. -- Jeremy Hetzler ------------------------------------- 520 $ /bin/rm nonexistent /bin/rm: cannot remove `nonexistent': No such file or directory 521 $ /bin/rm -f nonexistent 522 $ rm --version rm (GNU coreutils) 8.5 Packaged by Cygwin (8.5-2) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Paul Rubin, David MacKenzie, Richard M. Stallman, and Jim Meyering. --0016e647160c9e3c150498f29572 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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.

-- = Jeremy Hetzler

-------------------------------------

520 $ /b= in/rm nonexistent
/bin/rm: cannot remove `nonexistent': No such file or directory

= 521 $ /bin/rm -f nonexistent

522 $ rm --version
rm (GNU coreutils= ) 8.5
Packaged by Cygwin (8.5-2)
Copyright (C) 2010 Free Software Fou= ndation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free = software: you are free to change and redistribute it.
There is NO WARRAN= TY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, Richard M. Stallman,
and Jim= Meyering.


--0016e647160c9e3c150498f29572-- From unknown Sun Aug 17 02:00:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7775: rm -f emits no error message when deleting nonexistent file Resent-From: Eric Blake Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 03 Jan 2011 16:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7775 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Jeremy Hetzler Cc: 7775@debbugs.gnu.org Received: via spool by 7775-submit@debbugs.gnu.org id=B7775.1294073600508 (code B ref 7775); Mon, 03 Jan 2011 16:54:02 +0000 Received: (at 7775) by debbugs.gnu.org; 3 Jan 2011 16:53:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZnep-000089-PA for submit@debbugs.gnu.org; Mon, 03 Jan 2011 11:53:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZnem-00007v-Dd for 7775@debbugs.gnu.org; Mon, 03 Jan 2011 11:53:18 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p03H0Mth012791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 Jan 2011 12:00:22 -0500 Received: from [10.3.113.114] (ovpn-113-114.phx2.redhat.com [10.3.113.114]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p03H0MD7027150; Mon, 3 Jan 2011 12:00:22 -0500 Message-ID: <4D2200A5.2000000@redhat.com> Date: Mon, 03 Jan 2011 10:00:21 -0700 From: Eric Blake Organization: Red Hat 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 MIME-Version: 1.0 References: In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigA61C4E69D8F8712A3172D1B9" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -10.2 (----------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.2 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA61C4E69D8F8712A3172D1B9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 01/03/2011 08:12 AM, Jeremy Hetzler wrote: > rm normally produces an error when you delete a nonexistent file. Howev= er, > 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: >=20 > a. If the -f option is not specified, rm shall write a diagnostic me= ssage 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. --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enigA61C4E69D8F8712A3172D1B9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJNIgClAAoJEKeha0olJ0Nqqt0H/Aza3RiRrmdJuWDEQ7bZFQar qbhWFvd9PTJ7I6cVd0vYUFFlwkgDkHa6ELNHmISkUeep/9Ep9bpQDJ4eYR45niuN yYHNW0LTAaB9RsReWFdKQwr6xzsda0TgrB9E3BOXLNklnHWLRUXX4M9dQAdf2KP5 baoSNvVHr+NPOzRg9VNd9UgWPii03C1vktfiYNWaLEnElUlKGnUzfEo+M6UFx+Vu wrXoR8jctXehp5nD2fYd9h2+mZiB5a6F9On/8y6UF267r/+yVjMKUDHhp+3E5Ljw 7LscY6ilSdl0zaUv4ynKuHeGIf1XsM76ep9FyhZBG2dyfTyyFwr4QmcjKzhrp9Q= =Tsoc -----END PGP SIGNATURE----- --------------enigA61C4E69D8F8712A3172D1B9-- From unknown Sun Aug 17 02:00:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jeremy Hetzler Subject: bug#7775: closed (Re: bug#7775: rm -f emits no error message when deleting nonexistent file) Message-ID: References: <20110103170121.GA8477@hysteria.proulx.com> X-Gnu-PR-Message: they-closed 7775 X-Gnu-PR-Package: coreutils Reply-To: 7775@debbugs.gnu.org Date: Mon, 03 Jan 2011 16:55:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1294073702-666-1" This is a multi-part message in MIME format... ------------=_1294073702-666-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #7775: rm -f emits no error message when deleting nonexistent file which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 7775@debbugs.gnu.org. --=20 7775: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D7775 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1294073702-666-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 7775-done) by debbugs.gnu.org; 3 Jan 2011 16:54:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZnfl-00009l-4s for submit@debbugs.gnu.org; Mon, 03 Jan 2011 11:54:17 -0500 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZnfj-00009V-H5 for 7775-done@debbugs.gnu.org; Mon, 03 Jan 2011 11:54:16 -0500 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 7A65021362; Mon, 3 Jan 2011 10:01:21 -0700 (MST) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 766762DD77; Mon, 3 Jan 2011 10:01:21 -0700 (MST) Date: Mon, 3 Jan 2011 10:01:21 -0700 From: Bob Proulx To: Jeremy Hetzler Subject: Re: bug#7775: rm -f emits no error message when deleting nonexistent file Message-ID: <20110103170121.GA8477@hysteria.proulx.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 7775-done Cc: 7775-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) 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. Thank you for the bug report. But this is not a bug. That is the correct and desired behavior. That is the way it is supposed to work. This is documented in the manual. $ info coreutils 'rm invocation' `-f' `--force' Ignore nonexistent files and never prompt the user. Ignore any previous `--interactive' (`-i') option. This is core behavior and is also standardized across all Unix systems. Here is a pointer to the online standards documentation. http://pubs.opengroup.org/onlinepubs/009695399/utilities/rm.html Bob ------------=_1294073702-666-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 3 Jan 2011 15:54:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZmk0-0007Kq-7p for submit@debbugs.gnu.org; Mon, 03 Jan 2011 10:54:36 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZlyi-0006E3-7C for submit@debbugs.gnu.org; Mon, 03 Jan 2011 10:05:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZm5a-0001jJ-3Q for submit@debbugs.gnu.org; Mon, 03 Jan 2011 10:12:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:60286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZm5a-0001jF-17 for submit@debbugs.gnu.org; Mon, 03 Jan 2011 10:12:50 -0500 Received: from [140.186.70.92] (port=46001 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZm5Z-0002Tj-21 for bug-coreutils@gnu.org; Mon, 03 Jan 2011 10:12:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZm5Y-0001ip-1j for bug-coreutils@gnu.org; Mon, 03 Jan 2011 10:12:48 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:42463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZm5X-0001ie-Tu for bug-coreutils@gnu.org; Mon, 03 Jan 2011 10:12:48 -0500 Received: by wyj26 with SMTP id 26so13978021wyj.0 for ; Mon, 03 Jan 2011 07:12:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=WhX+3f8miQUffxu8wQmRR/z67JP2IIr//jLflrKbxDQ=; b=DrXmy4IH+iGOpFw4sL4fkuEn3h4fZrZW9dc/3n608EC/Dmp6I9Qha3477hTN837lDV +gFwX5RPov+RsSjp5PqAnq1A4PAXrkRlIZa/z2mDHCAZlOU+j3rtVJMgu3dTEFE6opq4 eCh0pv7hMnLxc4cQeAioudL34BUFnm2141L3g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=X1sgriis9inZj3A4iwyY5+7J3qUFmRfGlsjhweoqNpVIphNHpI6x/oOMqRwU34jLYL kfjaLVQtLsd1dMJo4fnpGbq9QnCsszwI6xO8Nxo+boZn2qTSj4/IEpkhS4vPG4/l/3RL E78O1HiRxcjbmmnwSB2+G/Zm437TY/Nu1H+og= Received: by 10.227.146.133 with SMTP id h5mr11588179wbv.42.1294067566525; Mon, 03 Jan 2011 07:12:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.138.12 with HTTP; Mon, 3 Jan 2011 07:12:26 -0800 (PST) From: Jeremy Hetzler Date: Mon, 3 Jan 2011 10:12:26 -0500 Message-ID: Subject: rm -f emits no error message when deleting nonexistent file To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary=0016e647160c9e3c150498f29572 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 03 Jan 2011 10:54:35 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --0016e647160c9e3c150498f29572 Content-Type: text/plain; charset=ISO-8859-1 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. -- Jeremy Hetzler ------------------------------------- 520 $ /bin/rm nonexistent /bin/rm: cannot remove `nonexistent': No such file or directory 521 $ /bin/rm -f nonexistent 522 $ rm --version rm (GNU coreutils) 8.5 Packaged by Cygwin (8.5-2) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Paul Rubin, David MacKenzie, Richard M. Stallman, and Jim Meyering. --0016e647160c9e3c150498f29572 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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.

-- = Jeremy Hetzler

-------------------------------------

520 $ /b= in/rm nonexistent
/bin/rm: cannot remove `nonexistent': No such file or directory

= 521 $ /bin/rm -f nonexistent

522 $ rm --version
rm (GNU coreutils= ) 8.5
Packaged by Cygwin (8.5-2)
Copyright (C) 2010 Free Software Fou= ndation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free = software: you are free to change and redistribute it.
There is NO WARRAN= TY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, Richard M. Stallman,
and Jim= Meyering.


--0016e647160c9e3c150498f29572-- ------------=_1294073702-666-1-- From unknown Sun Aug 17 02:00:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7775: rm -f emits no error message when deleting nonexistent file Resent-From: Jeremy Hetzler Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 03 Jan 2011 17:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7775 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Eric Blake Cc: 7775@debbugs.gnu.org Received: via spool by 7775-submit@debbugs.gnu.org id=B7775.12940747332122 (code B ref 7775); Mon, 03 Jan 2011 17:13:01 +0000 Received: (at 7775) by debbugs.gnu.org; 3 Jan 2011 17:12:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZnx6-0000YB-LN for submit@debbugs.gnu.org; Mon, 03 Jan 2011 12:12:12 -0500 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PZnx4-0000Xw-AV for 7775@debbugs.gnu.org; Mon, 03 Jan 2011 12:12:11 -0500 Received: by wwj40 with SMTP id 40so15073431wwj.15 for <7775@debbugs.gnu.org>; Mon, 03 Jan 2011 09:19:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=oudTnXrkcnu/Xl+OBG1NkUt79vFMLOirKt11EOB+iKk=; b=uU2mOzrBUWdKQ8OA0D9IfgaPoWLEuzOAGOcpyNBX5pelAxZxQgjOm7S+2yobUrqLwK bfHkkliQfSyY0SW2wWubj6doRAyCsVpYxIvg6REN6hzDxv74c4KJHxVLGJjGTV6VQrBf DfeRftGdPm4SFS6ZG+3yzSp9paPHT3WFObgr0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=HjG/IYUSrI764gsEk+a8bA8Q19PFz7V0tCxcInnVwA/egdDjyPdHyQkWENgJq8tFyV vqbRQp0f02vAD4c40Gr+8+kbEX7UxdKNvE7Ce1oABSQrMmj5FF6VS4fv37E9JA8EKe+o TG243tqh6GyFHTV95Ed2g4Q7AblwJVDqQnVTQ= Received: by 10.227.93.32 with SMTP id t32mr11694362wbm.158.1294075156590; Mon, 03 Jan 2011 09:19:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.138.12 with HTTP; Mon, 3 Jan 2011 09:18:56 -0800 (PST) In-Reply-To: <4D2200A5.2000000@redhat.com> References: <4D2200A5.2000000@redhat.com> From: Jeremy Hetzler Date: Mon, 3 Jan 2011 12:18:56 -0500 Message-ID: Content-Type: multipart/alternative; boundary=000e0cd4051e0571e10498f45ab0 X-Spam-Score: -4.8 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.4 (----) --000e0cd4051e0571e10498f45ab0 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Jan 3, 2011 at 12:00 PM, Eric Blake wrote: > 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. > > I see. Thanks. --- Jeremy Hetzler --000e0cd4051e0571e10498f45ab0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Mon, Jan 3, 2011 at 12:00 PM, Eric Blake <eblake@redhat.com> wrote:
On 01/03/2011 08:12 AM, Jeremy Hetzler wrote:
> rm normally produces an error when you delete a nonexistent file. Howe= ver,
> 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 requi= red
by POSIX:

http://pubs.opengroup.org/onlinepubs/9699919799/utilit= ies/rm.html

> 1. If the file does not exist:
>
> =A0 =A0a. If the -f option is not specified, rm shall write a diagnost= ic message to standard error.
> =A0 =A0b. Go on to any remaining files.

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


I see. Thanks.
---
Jeremy Hetzler
--000e0cd4051e0571e10498f45ab0--