[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#31912: Question for David MacKenzie - why an mkdir has no silent mod
From: |
Eric Blake |
Subject: |
bug#31912: Question for David MacKenzie - why an mkdir has no silent mode (-f key) like a chmod? |
Date: |
Thu, 21 Jun 2018 16:23:09 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
tag 31912 notabug
thanks
On 06/20/2018 06:18 AM, address@hidden 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