more use tofile instead of todir