in reply to Win32: Deleting Temporary directories of all users on a machine (recursive)?
zapfile ($subdir); sub zapfile { my ($file) = shift; print "Removing $file...\n"; if (-d $file) { opendir(my $dh, $file) or die "Unable to open $file: $!"; while (my $name = readdir($dh)) { next if $name eq '.' or $name eq '..'; # Recursive call! zapfile ("$file/$name"); } closedir $dh; rmdir ($file) or die "Unable to rmdir $file: $!"; } else { unlink $file or die "Unable to remove $file: $!"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Win32: Deleting Temporary directories of all users on a machine (recursive)?
by matze77 (Friar) on Jan 13, 2010 at 11:07 UTC | |
by Marshall (Canon) on Jan 13, 2010 at 12:00 UTC | |
|
Re^2: Win32: Deleting Temporary directories of all users on a machine (recursive)?
by matze77 (Friar) on Jan 13, 2010 at 14:20 UTC | |
by cdarke (Prior) on Jan 15, 2010 at 13:41 UTC |