Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The script dies at my @names = readdir(DIR) or die "Unable to read current dir: $!\n"; closedir(DIR); with a "Bad file descriptor" error message.open(DIR, ".") or die "Can't open the current directory: $!\n"; my @names = readdir(DIR) or die "Unable to read current dir: $!\n"; closedir(DIR); foreach my $name (@names) { next if ($name eq "."); next if ($name eq ".."); if (-d $name) { print "found a directory: $name\n"; next; } if ($name eq 'core') { print "found 'core' file!\n"; } }
What does that mean?
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 1: Bad file descriptor
by tilly (Archbishop) on Jan 28, 2001 at 06:16 UTC | |
by bman (Sexton) on Jan 28, 2001 at 06:30 UTC | |
|
Re: Bad file descriptor
by moen (Hermit) on Jan 28, 2001 at 06:17 UTC | |
|
Re: Bad file descriptor
by Beatnik (Parson) on Jan 28, 2001 at 06:23 UTC | |
|
Re: Bad file descriptor
by quidity (Pilgrim) on Jan 28, 2001 at 06:18 UTC |