Hi, Thanks it works perfectly. I understand my error now. Using the $File::Find::name for verifying if the folder exist was wrong since find is changing directory.
Thanks a lot -----Original Message----- From: $Bill Luebkert [mailto:[EMAIL PROTECTED] Sent: Thursday, September 09, 2004 11:17 AM To: Francis Paulin Cc: [EMAIL PROTECTED] Subject: Re: File::Find Francis Paulin wrote: > Hi, > > This the code snippet that can reproduce the problem > > # Code BEGIN > use strict; > use File::Find; > > sub IsDirectory() > { > my $tmpFileName = $File::Find::name; > > if (-d $tmpFileName) > { > print($tmpFileName . "\n"); > } > } > > find(\&IsDirectory,".."); > > # Code END > > When calling the find function, if the script is in D:\test\scripts, it will > stop the recursive search at a depth of two. So D:\test\hello will be found, > D:\test\hello\world will be found too, but D:\test\hello\world\again\ will > not be found because the find function seems to stop the search. > > Having such kind of directory structure will provide the output needed. > > I'm running with Windows XP Pro on Activestate Perl 5.8.4. I also try using > "../" or "..\" as the directory argument of find. The same result occures Try this one: use strict; use File::Find; sub IsDirectory { print $File::Find::name . "\n" if -d $_; } find (\&IsDirectory, ".."); __END__ > From: $Bill Luebkert [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 08, 2004 7:08 PM > To: Francis Paulin > Cc: [EMAIL PROTECTED] > Subject: Re: File::Find > > Francis Paulin wrote: > > >>Hi, >> >>I've got problem when using the find function from the File::Find module. >>When I try to use the find function with relative path using ".." as the >>path argument of find, it does not recurse completely into the tree >>directory. Behalf of that, if I use the physical path of "..", it will > > work > >>and will recurse the directory completely >> >>find(\&IsUCClassesDirectory,".."); # will not recurse the directory tree >>completely (the script is launched from d:\test\scripts\) >> >>find(\&IsUCClassesDirectory,"D:\\test\\directory_tree_here"); will recurse >>the directory tree completely. >> >> >>Curiously, using find with the relative path will only search directories > > in > >>a maximum depth of two. >>If this is normal, a bug or do I am doing something wrong? > > > Probably. Post a small complete test snippet that fails for you with a bit > of > the output showing the problem. > -- ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs