tag 31912 notabug
thanks

On 06/20/2018 06:18 AM, [email protected] wrote:
Hi,

A simple question for David MacKenzie - why an mkdir has no silent mode (-f 
key) like a chmod?

I'm not David (and it's been a while since he's posted anything to this list anyway), but thanks to the wonders of open source, you don't specifically need David to answer your question.

The first reason that 'mkdir -f' does not exist is historical: POSIX doesn't require it, because no one has ever implemented it. Remember, 'chmod -f' was added more than 30 years ago, and standardized by POSIX because it was common practice. But without common practice, it's hard to argue that we would be benefitted from having 'mkdir -f'.

The second reason is that 'mkdir -p' probably already does what you think a potential 'mkdir -f' should do. After all, what errors do you want to suppress other than a directory that already exists? And 'mkdir -p' IS standardized by POSIX, again with more than 30 years of history.

But if you are really insistent on adding a new option, please describe what it will do that existing options cannot do, rather than just asking why it doesn't exist. I'm marking the bug report as closed, but we can reopen it later if you have convincing arguments (and a patch is more convincing than just words) of why we'd want to add it.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



Reply via email to