Leser: 2
5 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /usr/bin/perl
use strict;
use warnings;
use File::Find;
my $dir = './testdir';
my @dirs;
find(\&get_dir,$dir);
rmdir($_) for(reverse(@dirs)); # rmdir löscht nur leere Verzeichnisse
sub get_dir{
push(@dirs,$File::Find::name) if(-d $_);
}# get_dir
Quote\n\nrmdir FILENAME
rmdir Deletes the directory specified by FILENAME if
that directory is empty. If it succeeds it
returns true, otherwise it returns false and sets
$! (errno). If FILENAME is omitted, uses $_.
5 Einträge, 1 Seite |