Added do_link_all function for better dir linking