I have a public/cache folder which has files and folders. How can I completely empty that folder using a rake task?
I have a public/cache folder which has files and folders. How can I completely
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ruby has the *nix
rm -rfequivalent in the FileUtils module that you can use to delete both files and non-empty folders/directories:To keep the directory itself and only remove its contents: