Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Oct 2014 20:11:02 -0700
From:      Garrett Cooper <yaneurabeya@gmail.com>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        src-committers@freebsd.org, svn-src-stable-10@freebsd.org, John Baldwin <jhb@freebsd.org>, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Glen Barber <gjb@freebsd.org>
Subject:   Re: svn commit: r272372 - stable/10/bin/rm
Message-ID:  <B01C20CC-3034-43AC-B776-A396E15DD6D1@gmail.com>
In-Reply-To: <20141003084842.T998@besplex.bde.org>
References:  <201410011618.s91GIfR5071251@svn.freebsd.org> <20141002141656.Y1807@besplex.bde.org> <20141002061628.GO1275@hub.FreeBSD.org> <201410021713.57943.jhb@freebsd.org> <20141003084842.T998@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_7CDEB9E0-CF06-451B-971D-D7DC20EFC349
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252

On Oct 2, 2014, at 16:34, Bruce Evans <brde@optusnet.com.au> wrote:

> There is still the larger problem with fts_read().  Applications like =
rm
> are specified to do a complete tree walk, with special handling for =
files
> that do not exist.  If fts_read() is going to abort in the middle of a
> tree walk, then it is unusable for implementing applications like rm.

+1. In this case I was doing a du -sh /* while I was running rm -Rf /rel =
(an old make release directory tree). This stopped the du -sh:

$ sudo du -sh /*                                                         =
                                                                         =
                             =20
8.0K    /COPYRIGHT
996K    /bin
218M    /boot
  0B    /boot.config
2.5K    /dev
4.0K    /entropy
2.2M    /etc
1.0G    /home
 16M    /lib
280K    /libexec
4.0K    /media
4.0K    /mnt
4.0K    /proc
du: /rel/usr/ports/net/samba36: No such file or directory
du: /rel/usr/ports/net/aslookup: No such file or directory
du: /rel/usr/ports/net/p5-Net-Amazon-AWSSign: No such file or directory
du: /rel/usr/ports/net/p5-Net-Server-SS-PreFork: No such file or =
directory
du: /rel/usr/ports/net/lla: No such file or directory
du: /rel/usr/ports/net/sslh: No such file or directory
du: /rel/usr/ports/net/wmlj: No such file or directory
du: /rel/usr/ports/net/sendsms: No such file or directory
du: /rel/usr/ports/net/uriparser: No such file or directory
du: /rel/usr/ports/net/p5-Data-IPV4-Range-Parse: No such file or =
directory
du: /rel/usr/ports/net/cagibi: No such file or directory
du: /rel/usr/ports/net/fsplib: No such file or directory
du: fts_read: No such file or directory

	The problem with changing fts_read to ignore ENOENT or other =
errors will break compatibility with Linux [and other OSes potentially], =
and is not the correct solution for this issue. I do however think that =
the errnos to ignore with -f should be...

- EACCES
- ENOENT
- EPERM

	=85 as filtering out these errors would handle the case that -f =
should handle according to the manpage:

     -f      Attempt to remove the files without prompting for =
confirmation,
             regardless of the file's permissions.  If the file does not
             exist, do not display a diagnostic message or modify the =
exit
             status to reflect an error.  The -f option overrides any =
previous
             -i options.

Thanks,
-Garrett

--Apple-Mail=_7CDEB9E0-CF06-451B-971D-D7DC20EFC349
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQEcBAEBCgAGBQJUL2VGAAoJEMZr5QU6S73ejPIH/1OaP9BHeJlVIwCwtzE9od2u
yOMa8KH/4gzsYRQ15puBrZ2CDBIuwFbLmuAp1aaoiSCTf+EUqDCG4RT1+LcQ/d3D
E+XHCqQ6RrgVuxyRohYcfFQk0bhvrc8sRkQaKBzRHCqk8TCHPoJydi9Ix7Ir2lem
tPQOyq9fdUQlzN6dFdBMUAQCrwC0sN8Ozk0qxDeQnlMgD/w/paOemmQ3Bx4Yw7Pv
17C6ZsdccUtDwLB7yXtKLd7WMeJYUEtoqZKI4AEIIzBqyJdek0EBBxELoSFsL/bG
8RPvxEV4Pwi+CM/ItVjxnugwSMF/6s1vI89enoBJJgcUyEf1MXo1K2SylBQaoGU=
=5ft1
-----END PGP SIGNATURE-----

--Apple-Mail=_7CDEB9E0-CF06-451B-971D-D7DC20EFC349--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B01C20CC-3034-43AC-B776-A396E15DD6D1>