Modify

Opened 6 years ago

Closed 5 years ago

#5653 closed Bugs (fixed)

recursive_directory_iterator(error_code) can still throw filesystem_error

Reported by: Geurt Vos <geurt.vos@…> Owned by: bemandawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.46.1 Severity: Problem
Keywords: Cc:

Description

internally recursive_directory_iterator uses other filesystem facilities (such as is_directory and is_symlink) without passing the system::error_code argument. If they fail, they will throw filesystem_error.

Example on Linux (see ticket #5652):

int main() {

try {

error_code ec; for (recursive_directory_iterator i(".", ec); i != recursive_directory_iterator(); ++i) ;

} catch (const std::exception& e) {

std::cout << ">> " << e.what() << std::endl;

}

}

$ ln -s mybadlink mybadlink $ ./test

boost::filesystem::status: Too many levels of symbolic links: "./mybadlink"

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by bemandawes

  • Resolution set to fixed
  • Status changed from new to closed

(In [76667]) Fix #5653, recursive_directory_iterator(error_code) can still throw filesystem_error. Fix a second bug, discovered while testing 5653; recursive_directory_iterator::increment with error_code argument was not reporting the end iterator.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain bemandawes.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.