Discussion:
[1003.1(2008)/Issue 7 0000843]: mkdir -p exit status inaccurate
Austin Group Bug Tracker
2014-06-02 18:52:44 UTC
Permalink
The following issue has been SUBMITTED.
======================================================================
http://austingroupbugs.net/view.php?id=843
======================================================================
Reported By: sebor
Assigned To: ajosey
======================================================================
Project: 1003.1(2008)/Issue 7
Issue ID: 843
Category: System Interfaces
Type: Error
Severity: Editorial
Priority: normal
Status: Under Review
Name: Martin sebor
Organization: Cisco Systems, Inc.
User Reference:
Section: mkdir
Page Number: 2964
Line Number: 98169, 98170
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2014-06-02 18:52 UTC
Last Modified: 2014-06-02 18:52 UTC
======================================================================
Summary: mkdir -p exit status inaccurate
Description:
mkdir specifies that the exit values shall be zero when:

All the specified directories were created successfully or the -p
option was specified and all the specified directories now exist.

The part "all the specified directories now exist" suggests that the
directories are guaranteed to exist at the time the command exits (i.e.,
the word "now" means "immediately after mkdir exits"), even though it may
not be the case when another process executing concurrently with mkdir
removes one or more of the the directories just after mkdir has verified
their existence but before it has exited.
Desired Action:
Replace the sentence:

All the specified directories were created successfully or the -p
option was specified and all the specified directories now exist.

with:

All the specified directories were created successfully or the -p
option was specified and all the specified directories were either found to
already exist or created successfully.
======================================================================

Issue History
Date Modified Username Field Change
======================================================================
2014-06-02 18:52 sebor New Issue
2014-06-02 18:52 sebor Status New => Under Review
2014-06-02 18:52 sebor Assigned To => ajosey
2014-06-02 18:52 sebor Name => Martin sebor
2014-06-02 18:52 sebor Organization => Cisco Systems, Inc.
2014-06-02 18:52 sebor Section => mkdir
2014-06-02 18:52 sebor Page Number => 2964
2014-06-02 18:52 sebor Line Number => 98169, 98170
======================================================================
Schwarz, Konrad
2014-06-03 07:50:57 UTC
Permalink
-----Original Message-----
Sent: Montag, 2. Juni 2014 20:53
Subject: [1003.1(2008)/Issue 7 0000843]: mkdir -p exit status
inaccurate
The part "all the specified directories now exist" suggests that the
directories are guaranteed to exist at the time the command exits
(i.e., the word "now" means "immediately after mkdir exits"), even
though it may not be the case when another process executing
concurrently with mkdir removes one or more of the the directories just
after mkdir has verified their existence but before it has exited.
All the specified directories were created successfully or the -p
option was specified and all the specified directories now exist.
All the specified directories were created successfully or the -p
option was specified and all the specified directories were either
found to already exist or created successfully.
I not sure this is a worthwhile change. Even with the original
wording, the possibility exists for the directories to be changed
after the return status of mkdir -p has been evaluated.

Since the guarantees offered by the alternatives are identical,
the original, simpler formulation seems preferrable.

Loading...