Title
[filesys.ts] [PDTS] directory_options::skip_permission_denied is not used
Status
open
Section
[fs.filesystem.synopsis]
Submitter
P.J. Plauger

Created on 2014-01-30.00:00:00 last changed 89 months ago

Messages

Date: 2016-01-28.01:00:35

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 of directory_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 access  p 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 access  p 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) != 0 directory_options::none) then either directory (*this)->path() is recursively iterated into or, if options() & 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 .
Date: 2016-01-28.01:00:35

[ 17 Jun 2014 LWG requests two signatures rather than one with default argument. Beman updates wording. ]

Date: 2014-04-13.00:00:00

[ 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. ]

Date: 2016-01-31.20:31:05

Addresses: filesys.ts

directory_options::skip_permission_denied is not used.

History
Date User Action Args
2017-07-30 20:10:41adminsetstatus: wp -> open
2016-01-28 01:00:35adminsetmessages: + msg7815
2016-01-28 01:00:35adminsetmessages: + msg7814
2016-01-28 01:00:35adminsetmessages: + msg7813
2014-01-30 00:00:00admincreate