GNU bug report logs -
#7775
rm -f emits no error message when deleting nonexistent file
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7775 in the body.
You can then email your comments to 7775 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
:
bug#7775
; Package
coreutils
.
(Mon, 03 Jan 2011 15:55:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Jeremy Hetzler <jeremyhetzler <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Mon, 03 Jan 2011 15:55:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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 <http://gnu.org/licenses/gpl.html
>.
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.
[Message part 2 (text/html, inline)]
Information forwarded
to
owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
:
bug#7775
; Package
coreutils
.
(Mon, 03 Jan 2011 16:54:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 7775 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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 eblake <at> redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
Reply sent
to
Bob Proulx <bob <at> proulx.com>
:
You have taken responsibility.
(Mon, 03 Jan 2011 16:55:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Jeremy Hetzler <jeremyhetzler <at> gmail.com>
:
bug acknowledged by developer.
(Mon, 03 Jan 2011 16:55:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 7775-done <at> debbugs.gnu.org (full text, mbox):
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
Message #14 received at 7775-done <at> debbugs.gnu.org (full text, mbox):
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.
...
> 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
Thanks for the report, but that's not a bug.
Rather, it is long-standing, documented and required behavior:
$ rm --help :
Usage: rm [OPTION]... FILE...
Remove (unlink) the FILE(s).
-f, --force ignore nonexistent files, never prompt
Information forwarded
to
owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
:
bug#7775
; Package
coreutils
.
(Mon, 03 Jan 2011 17:13:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 7775 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Mon, Jan 3, 2011 at 12:00 PM, Eric Blake <eblake <at> redhat.com> 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
[Message part 2 (text/html, inline)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 01 Feb 2011 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 199 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.