for each dir ( dirs) # I am using pseudo-code...:-) => if chdir(dir) => do smth. there => else ==> print_warning(couldn't go to dir, skipping) ......