Add function to deal with folder and files