deadpickle has asked for the wisdom of the Perl Monks concerning the following question:
which tells me that it is trying to open the . or .. file. Any ideas on how I can get around this?C:\Documents and Settings\UAS\Desktop\GRRUVI\gps\. stat() on closed filehandle KID at GRRUVI-v1.611-gpsa.pl line 1950. readline() on closed filehandle KID at GRRUVI-v1.611-gpsa.pl line 1951 +.
opendir(GPS,"$new_dir") or die "Cannot open direct +ory"; my @GPS = readdir(GPS); closedir(GPS); foreach my $kid (@GPS){ #~ if ($kid ne "." or $kid ne ".."){ if (defined($kid)){ if ($kid !~ /.bak/ or $kid !~ /.txt/ o +r $kid !~ /^\.{1,2}$/){ #~ if ($kid !~ /.bak/ or $kid !~ /.txt +/){ open KID , '<', "$new_dir\\$kid"; my ($dev,$ino,$mode,$nlink,$uid,$g +id,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat(KID); my $data = <KID>; close KID; if (defined($data)){ my @data = split(" ", $data); my $diff = time-$mtime; if ($diff >= 3600){ unlink($kid); } elsif ($diff >= 20){ } } } #~ } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Catching . .. in file listing
by kennethk (Abbot) on May 01, 2009 at 16:55 UTC | |
|
Re: Catching . .. in file listing
by toolic (Bishop) on May 01, 2009 at 17:05 UTC | |
by johngg (Canon) on May 01, 2009 at 17:19 UTC |