develooper Front page | perl.beginners | Postings from January 2002

using stat and file::find

From:
Ben Crane
Date:
January 10, 2002 07:40
Subject:
using stat and file::find
Message ID:
20020110154057.25708.qmail@web14501.mail.yahoo.com
hey guys, I have this code that prints out the direc
structure/filenames for whatever root i choose...I
would like to have a stat for each file...how do i go
about doing this? I thought about adding it in the
wanted() sub but I've had little success...I want each
file to have all the necessary stat's so my text file
has all the information i need on each file...I plan
on using vb to create a mini dbase to "mess" around
with the webstructure.txt file

#!usr/bin/perl -w
use File::Find;


$DIREC=<STDIN>;
chomp($DIREC);

open(DEST,">WebStructure.txt") || die "$!";
  
find \&wanted, $DIREC;

sub wanted()

{

 map {$_=>1} $DIREC;
 print DEST stat("$File::Find::name\n");
 
}
close(DEST)

Ben

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About