Ben
I think the problem is that you're not removing the record separator from
the end of $dirvalue. Try with
chomp $dirvalue;
at the top of the loop. If that doesn't work, let us know the exact error
message you get from the stat() call.
HTH,
Rob
- Original Message -
From: Ben Crane [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 22, 2002 2:54 PM
Subject: file not found : stat problem
Hi list,
I've got a silly problem that for some reason I can't
work out..the following program goes through a txt
file that contain folder structures, e.g. j:\temp\ex\
I want the program too loop through the array, and
give me all the files within those directories and
their size...but sometimes it works, but most of the
time it just says:
can't stat etc and file not found...but I have used an
example of c:\temp (which does exist) and has files in
it...occasionally it works but mostly it doesn't...
Any reasons for why stat wouldn't work?
#!/perl/bin -w
use File::Find;
open (DLIST, c:/temp/dirlistforbatchcopy(pl).txt) ||
die opening log file: $!;
open (DEST, c:/temp/DirList.txt) || die opening
log file: $!;
@DLISTCONTENTS=DLIST;
sub getlist
{
{
print DEST $File::Find::name;
print DEST (stat($File::Find::name))[7];
print DEST \n;
}
}
foreach $dirvalue ( @DLISTCONTENTS )
{
find(\getlist, $dirvalue);
}
close(DEST);
close(DLIST);
thanx
Ben
__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]