Title
remove_all has incorrect post conditions
Status
c++17
Section
[fs.op.remove.all]
Submitter
Eric Fiselier

Created on 2016-05-28.00:00:00 last changed 81 months ago

Messages

Date: 2016-06-21.20:26:41

Proposed resolution:

This wording is relative to N4582.

  1. Change [fs.op.remove_all] as indicated:

    uintmax_t remove_all(const path& p);
    uintmax_t remove_all(const path& p, error_code& ec) noexcept;
    

    -1- Effects: Recursively deletes the contents of p if it exists, then deletes file p itself, as if by POSIX remove().

    -2- [Note: A symbolic link is itself removed, rather than the file it resolves to being removed. — end note]

    -3- Postcondition: !exists(symlink_status(p)).

Date: 2016-06-27.16:42:33

[ 2016-06, Oulu — Eric clarifies the importance of the suggested change ]

With the current post conditions remove_all(p) could just not remove dangling symlinks and still meet the post conditions.

Moved to Ready after Eric convinced the room.

Friday: status to Immediate

Date: 2016-05-28.00:00:00

The current post condition for remove_all(p, [...]) states:

Postcondition: !exists(p)

This is not correct when p is a symlink, since !exists(p) reads through the symlink. The postcondition should be changed to match that of remove which states !exists(symlink_status(p)).

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2016-06-28 13:14:43adminsetstatus: immediate -> wp
2016-06-27 16:42:33adminsetstatus: new -> immediate
2016-06-21 20:26:41adminsetmessages: + msg8192
2016-06-05 16:33:00adminsetmessages: + msg8161
2016-05-28 00:00:00admincreate