in reply to visit directories and more...
#!/usr/bin/perl -w sub dir_explorer { my $dir = $_[0]; opendir(DIR,$dir) or die "Konnte Verzeichnis $dir nicht öffnen: $!"; my @verzeichnis = readdir(DIR); close (DIR); foreach $entry (@verzeichnis) { if(-f $entry) { # formatieren($entry); print ("$entry ist ein file ! \n"); } else { next if $entry =~ /^.\.?$/; # . und .. überspringen print ("$entry ist ein directory ! \n"); dir_explorer($entry); } }; }; dir_explorer("/home/dub/Stelle");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: visit directories and more...
by WhiteBird (Hermit) on May 25, 2003 at 14:29 UTC | |
|
Re: Re: visit directories and more...
by star7 (Novice) on May 26, 2003 at 09:36 UTC |