Add a comment. Active Oldest Votes. Here is the code that I used:! Barton Chittenden Barton Chittenden 4, 2 2 gold badges 23 23 silver badges 46 46 bronze badges. Actually, each is a Perl function. Jonathan Leffler, Not in that situation it's not. Barton Sorry my mistake on the code, it was a typo. I am using foreach in my code but the problem persists. To add to that, it was working just fine last afternoon but since then I made various changes to my code but this little bit is causing problems and I'm still not able to figure out why.
It was a stupid mistake. I dint specify the whole path to the file while deleting and I was just passing the filename. I fixed it and its working just fine. Thanks all! Mujeeb khan Mujeeb khan 23 1 1 silver badge 6 6 bronze badges. I have files and folders that need to be deleted and hence I was using rm -rf. But unlink should work just fine on both files and folders right?
Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. This would be exactly the same as rm -rf. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.
Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Related Hot Network Questions. Question feed. Accept all cookies Customize settings. And given that you have right permissions and don't need this folder on your system all the time, you can simply remove it and create a new empty folder:. Sign up to join this community. The best answers are voted up and rise to the top.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Remove files and subdirectories of particular folder Ask Question. Asked 6 years, 4 months ago. Active 3 years, 1 month ago. Viewed 17k times. I need to remove files and sub-directories in a particular folder but not that folder itself. I am using below command: find. Improve this question. MatthewRock 6, 5 5 gold badges 27 27 silver badges 54 54 bronze badges.
0コメント