[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mkdir -p competition on the same directory?
From: |
Pádraig Brady |
Subject: |
Re: mkdir -p competition on the same directory? |
Date: |
Thu, 9 Feb 2023 16:08:52 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Thunderbird/109.0 |
On 09/02/2023 14:57, Peng Yu wrote:
https://lists.gnu.org/archive/html/help-bash/2023-02/msg00053.html
Bash loadable `mkdir -p` has a problem when multiple loadable `mkdir
-p` is called on the same directory simultaneously.
But I never see coreutils' `mkdir -p` has the same problem. Does
coreutils' `mkdir -p` do something extra to guard against the
competition on the same directory?
`mkdir d; strace mkdir -p d` would be instructive,
but yes coreutils mkdir essentially does:
if mkdir(d) == EEXIST
return stat(d) == S_ISDIR
cheers,
Pádraig
- mkdir -p competition on the same directory?, Peng Yu, 2023/02/09
- Re: mkdir -p competition on the same directory?,
Pádraig Brady <=
- Re: mkdir -p competition on the same directory?, Peng Yu, 2023/02/09
- Re: mkdir -p competition on the same directory?, Pádraig Brady, 2023/02/09
- Re: mkdir -p competition on the same directory?, Rob Landley, 2023/02/09
- Re: mkdir -p competition on the same directory?, Chet Ramey, 2023/02/09
- Re: mkdir -p competition on the same directory?, Pádraig Brady, 2023/02/09
- Re: mkdir -p competition on the same directory?, Chet Ramey, 2023/02/13