[DOCS-9481] Docs for SERVER-25839: shell mkdir should return whether a new directory was created Created: 02/Dec/16 Updated: 22/Feb/17 Resolved: 14/Feb/17 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Emily Hall | Assignee: | Steve Renaker (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Days since reply: | 6 years, 51 weeks, 6 days ago | ||||||||
| Description |
|
Engineering Ticket Description: The shell's mkdir() function is a wrapper around boost::filesystem::create_directories(). This function returns a bool indicating whether or not a new directory was created. However, the shell's mkdir throws away this return status, and instead always returns true (which is useless). This makes it impossible for shell code to determine whether a new directory has been created or not. This would be helpful for jstest code that needs to atomically create a new directory of its own, so that it can work inside that directory without worrying about other concurrent runs of the jstest, etc. The new return status should satisfy:
Simply returning the bool from boost::filesystem::create_directories() fails both of these requirements. Better would be to return an object such as
where the exists field is always true, indicating that the directory now exists (because if there was an error, an assertion would have been thrown), and the created field contains the result from create_directories (ie. whether or not a directory was actually created in response to this mkdir(), or whether the directory was pre-existing). |
| Comments |
| Comment by Githook User [ 16/Feb/17 ] |
|
Author: {u'username': u'steveren', u'name': u'Steve Renaker', u'email': u'steve.renaker@mongodb.com'}Message: Signed-off-by: kay <kay.kim@10gen.com> |