divide files according to the func.