5plit_func has asked for the wisdom of the Perl Monks concerning the following question:
I am have difficulty deleting a file from my computer hard disk the file is a .dat file and its located in the users/all users/Norton folder. I want to delete the contents of the folder and sub folder till i delete the Norton folder. Here is the sample code
opendir(DIR, "$path/$new_folder/$new_folder1/$third_layer") || die("Un +able to opend $third_layer : $!\n\n"); my @third_layer = readdir(DIR); closedir(DIR); print("Third layer is : @third_layer\n\n"); shift(@third_layer); shift(@third_layer); print("@third_layer\n\n"); @third_layer = map{ $_ = "$path/$new_folder/$new_folder1/$third_layer/ +$_"}@third_layer; if(unlink(@third_layer)) { print("Successfully deleted the following data : @third_layer\n\n" +); }else { print("Unable to delete the following data : @third_layer\n\n"); }
Any help will be highly appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unable to delete dat files from a folder in windows all users/norton folder
by Corion (Patriarch) on Nov 16, 2013 at 17:14 UTC | |
|
Re: unable to delete dat files from a folder in windows all users/norton folder
by kcott (Archbishop) on Nov 16, 2013 at 17:34 UTC | |
by RichardK (Parson) on Nov 16, 2013 at 17:56 UTC |