bug#15926: RFE: unlink command already uses 'unlink' call; make 'rm' use (original) (raw)


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


From: Eric Blake
Subject: bug#15926: RFE: unlink command already uses 'unlink' call; make 'rm' use 'remove' call
Date: Tue, 19 Nov 2013 18:28:54 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 11/19/2013 05:02 PM, Linda Walsh wrote:

I'm not see what would break. instead of failing to remove a non-empty directory, it would remove it (if it was empty and permissions allowed).

That's what would break. Scripts have been written to assume that 'rm empty_dir' will fail, and your proposal would change that assumption. Falling through to subsequent commands when you used to bail out early has all sorts of subtle implications, that we aren't willing to risk.

I would ask how it would fail in a script -- I.e. we are only talking empty directories -- and currently an error would be returned if a script tried to do that. If the script was catching errors or running with "-e", the script would terminate under the current implementation.

'set -e' is useless. I highly recommend that script writers avoid it.

-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature