directory_options::skip_permission_denied
is not usedSection: 6 [filesys.ts::fs.filesystem.synopsis] Status: TS Submitter: P.J. Plauger Opened: 2014-01-30 Last modified: 2017-07-30
Priority: Not Prioritized
View all other issues in [filesys.ts::fs.filesystem.synopsis].
View all issues with TS status.
Discussion:
Addresses: filesys.ts
directory_options::skip_permission_denied
is not used.
[2014-04-13 Beman: skip_permissions_denied
not being used is a
symptom of a more serious problem; two directory_itorator
constructors
are missing directory_options
arguments and a description of how they
are used. Proposed wording provided.]
[17 Jun 2014 LWG requests two signatures rather than one with default argument. Beman updates wording.]
Proposed resolution:
Change 13 [class.directory_iterator]:
directory_iterator() noexcept; explicit directory_iterator(const path& p); directory_iterator(const path& p, directory_options options); directory_iterator(const path& p, error_code& ec) noexcept; directory_iterator(const path& p, directory_options options, error_code& ec) noexcept; directory_iterator(const directory_iterator&) = default; directory_iterator(directory_iterator&&) = default; ~directory_iterator();
Change 13.1 directory_iterator members [directory_iterator.members]:
explicit directory_iterator(const path& p); directory_iterator(const path& p, directory_options options); directory_iterator(const path& p, error_code& ec) noexcept; directory_iterator(const path& p, directory_options options, error_code& ec) noexcept;Effects: For the directory that
p
resolves to, constructs an iterator for the first element in a sequence ofdirectory_entry
elements representing the files in the directory, if any; otherwise the end iterator.However, if
options & directory_options::skip_permissions_denied != directory_options::none
and construction encounters an error indicating that permission to accessp
is denied, constructs the end iterator and does not report an error.
Change 14
Class recursive_directory_iterator
[class.rec.dir.itr]
:
explicit recursive_directory_iterator(const path& p,directory_options options = directory_options::none); recursive_directory_iterator(const path& p, directory_options options); recursive_directory_iterator(const path& p, directory_options options, error_code& ec) noexcept; recursive_directory_iterator(const path& p, error_code& ec) noexcept;
Change 14.1 recursive_directory_iterator members [rec.dir.itr.members]:
explicit recursive_directory_iterator(const path& p,directory_options options = directory_options::none); recursive_directory_iterator(const path& p, directory_options options); recursive_directory_iterator(const path& p, directory_options options, error_code& ec) noexcept; recursive_directory_iterator(const path& p, error_code& ec) noexcept;Effects: Constructs a iterator representing the first entry in the directory
p
resolves to, if any; otherwise, the end iterator.However, if
options & directory_options::skip_permissions_denied != directory_options::none
and construction encounters an error indicating that permission to accessp
is denied, constructs the end iterator and does not report an error.
Change 14.1 recursive_directory_iterator members [rec.dir.itr.members]:
recursive_directory_iterator& operator++(); recursive_directory_iterator& increment(error_code& ec);Requires:
*this != recursive_directory_iterator()
.Effects: As specified by C++11 ยง 24.1.1 Input iterators, except that:
- If there are no more entries at this depth, then if
depth()!= 0
iteration over the parent directory resumes; otherwise*this = recursive_directory_iterator()
.- Otherwise if
recursion_pending() && is_directory(this->status()) && (!is_symlink(this->symlink_status()) || (options() & directory_options::follow_directory_symlink) !=
then either directory0directory_options::none)(*this)->path()
is recursively iterated into or, ifoptions() & directory_options::skip_permissions_denied != directory_options::none
and an error occurs indicating that permission to access directory(*this)->path()
is denied, then directory(*this)->path()
is treated as an empty directory and no error is reported .