Opened 2 years ago

Last modified 2 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:


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 Changed 2 years ago by ivan.mazovec@…

i have same problem.


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


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.