Hi I tried a simple script to remove the directory as below:
1. finddepth(sub{r mdir},'.') removed all the empty directories.
2. But I wanted to remove all the directories which are not empty. Hence I tried
to remove all directories inside test3 directory and it works.
Please let me know whether there are any other elegant way of removing directories? Removing the directories takes more time (approximately 20 minutes) and hence is it advisable to fork the process and do?Thanks.
Code:
#!/usr/bin/perl -w
use File::Find;
#finddepth(sub{rmdir},'.')
system('rm -rf test3');
2. But I wanted to remove all the directories which are not empty. Hence I tried
Code:
system('rm -rf test3');
Please let me know whether there are any other elegant way of removing directories? Removing the directories takes more time (approximately 20 minutes) and hence is it advisable to fork the process and do?Thanks.
Comment