# # patch "ChangeLog" # from [04b0ad05eb5abdebe641e3b2613443422cc8b3f3] # to [562c78e027298a0eb80566ee4838379923779d25] # # patch "file_io.cc" # from [db0c9de266a60eebe2647f754f8fbc30094719ce] # to [88a1397797187722cf0acdd674c3d03d2b127b0d] # ======================================================================== --- ChangeLog 04b0ad05eb5abdebe641e3b2613443422cc8b3f3 +++ ChangeLog 562c78e027298a0eb80566ee4838379923779d25 @@ -1,5 +1,10 @@ 2005-08-25 Nathaniel Smith + * file_io.cc (delete_dir_recursive): Implement. + Misc. compile fixes. + +2005-08-25 Nathaniel Smith + * file_io.cc (test_book_keeping_file): Remove. 2005-08-25 Nathaniel Smith ======================================================================== --- file_io.cc db0c9de266a60eebe2647f754f8fbc30094719ce +++ file_io.cc 88a1397797187722cf0acdd674c3d03d2b127b0d @@ -35,7 +35,7 @@ } void -assert_path_is_directory(any_path const & path); +assert_path_is_directory(any_path const & path) { I(get_path_status(path) == path::directory); } @@ -104,7 +104,7 @@ bool ident_existing_file(file_path const & p, file_id & ident, lua_hooks & lua) { - fs::path local_p(p.as_external); + fs::path local_p(p.as_external()); if (!fs::exists(local_p)) return false; @@ -116,7 +116,7 @@ case path::file: break; case path::directory: - W(F("expected file '%s', but it is a directory.") % p()); + W(F("expected file '%s', but it is a directory.") % p); return false; } @@ -167,9 +167,10 @@ void delete_dir_recursive(any_path const & p) { - N(directory_exists(p), - F("directory to delete '%s' does not exist") % p); - fs::remove_all(localized(p)); + require_path_is_directory(p, + F("directory to delete, '%s', does not exist") % p, + F("directory to delete, '%s', is a file") % p); + fs::remove_all(p.as_external()); } void @@ -182,7 +183,7 @@ "-- bug in monotone?") % old_path); N(!path_exists(new_path), F("rename target '%s' already exists") % new_path); - fs::rename(old_path, new_path); + fs::rename(old_path.as_external(), new_path.as_external()); } void @@ -195,7 +196,7 @@ "-- bug in monotone?") % old_path); N(!path_exists(new_path), F("rename target '%s' already exists") % new_path); - fs::rename(old_path, new_path); + fs::rename(old_path.as_external(), new_path.as_external()); } void @@ -216,7 +217,7 @@ } void -read_localized_data(any_path const & path, +read_localized_data(file_path const & path, data & dat, lua_hooks & lua) { @@ -357,8 +358,8 @@ for(fs::directory_iterator di(absolute); di != ei; ++di) { - fs::path entry = mkpath(di->string()); - fs::path rel_entry = relative / mkpath(entry.leaf()); + fs::path entry = *di; + fs::path rel_entry = relative / entry.leaf(); if (book_keeping_file(rel_entry)) {