Opened 6 years ago

Last modified 6 years ago

#12640 new Bugs

is_empty and remove_all may throw even when called with error_code& argument.

Reported by: nigel.pattinson@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.62.0 Severity: Problem
Keywords: Cc:

Description

Some of the code that underpins is_empty and remove_all constructs directory_iterator objects without passing through an error_code& argument. I have spotted this in both is_empty_directory and remove_all_aux . The latter also uses operator++ on the iterator rather than calling increment, I haven't checked whether this is more widespread.

Change History (1)

comment:1 by ivan.mazovec@…, 6 years ago

i have same problem.

code:

boost::system::error_code e;
boost::filesystem::is_empty("/lost+found", e);

output:

unknown location(0): fatal error: in "general_case": boost::filesystem::filesystem_error: boost::filesystem::directory_iterator::construct: Permission denied: "/lost+found"

Note: See TracTickets for help on using tickets.