Click here to get back home

Recursive directory read with File::Find

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Recursive directory read with File::Find kimanhtle 04-22-2008
Get Chitika Premium
Posted by kimanhtle on April 22, 2008, 6:43 pm
Please log in for more thread options
I would like to do a recursive read of a directory on my local
computer. Is this possible with File::Find? If not, is there any other
way to do it in Perl?

Posted by John W. Krahn on April 22, 2008, 6:54 pm
Please log in for more thread options
kimanhtle@gmail.com wrote:
> I would like to do a recursive read of a directory on my local
> computer. Is this possible with File::Find?

Yes.

> If not, is there any other way to do it in Perl?

TMTOWTDI

http://search.cpan.org/search?query=File%3A%3AFind&mode=all


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

Posted by kimanhtle on April 22, 2008, 11:14 pm
Please log in for more thread options
> kimanh...@gmail.com wrote:
> > I would like to do a recursive read of a directory on my local
> > computer. Is this possible with File::Find?
>
> Yes.
>
> > If not, is there any other way to do it in Perl?
>
> TMTOWTDI
>
> http://search.cpan.org/search?query=File%3A%3AFind&mode=all
>
> John
> --
> Perl isn't a toolbox, but a small machine shop where you
> can special-order certain sorts of tools at low cost and
> in short order. -- Larry Wall


Thanks! Would you happen to have an example? I only got it to work for
a UNIX path not a path on my local computer. It could be I didn't
escape the path right. For example, if I have "C:\projects\docs
\HUNGER_AWARENESS_04212008", would I have to pass it as "C:\projects\
\docs\HUNGER_AWARENESS_04212008"?


Posted by John W. Krahn on April 22, 2008, 11:21 pm
Please log in for more thread options
kimanhtle@gmail.com wrote:
>
>>
>> kimanh...@gmail.com wrote:
>>>
>>> I would like to do a recursive read of a directory on my local
>>> computer. Is this possible with File::Find?
>>
>> Yes.
>>
>>> If not, is there any other way to do it in Perl?
>>
>> TMTOWTDI
>>
>> http://search.cpan.org/search?query=File%3A%3AFind&mode=all
>
> Thanks! Would you happen to have an example? I only got it to work for
> a UNIX path not a path on my local computer. It could be I didn't
> escape the path right. For example, if I have "C:\projects\docs
> \HUNGER_AWARENESS_04212008", would I have to pass it as "C:\projects\
> \docs\HUNGER_AWARENESS_04212008"?

Or 'C:/projects/docs/HUNGER_AWARENESS_04212008' should work as well.


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

Posted by A. Sinan Unur on April 22, 2008, 11:22 pm
Please log in for more thread options
kimanhtle@gmail.com wrote in news:9c1c4e83-24cb-4a0a-a888-9f191ff99111
@w7g2000hsa.googlegroups.com:

>> kimanh...@gmail.com wrote:
>> > I would like to do a recursive read of a directory on my local
>> > computer. Is this possible with File::Find?
>>
>> Yes.
>>
>> > If not, is there any other way to do it in Perl?
>>
>> TMTOWTDI
>>
>> http://search.cpan.org/search?query=File%3A%3AFind&mode=all
>>
>> John
>> --

[ don't quote sigs ]

>
> Thanks! Would you happen to have an example? I only got it to work for
> a UNIX path not a path on my local computer. It could be I didn't
> escape the path right. For example, if I have "C:\projects\docs
> \HUNGER_AWARENESS_04212008", would I have to pass it as "C:\projects\
> \docs\HUNGER_AWARENESS_04212008"?

From perlfaq5:

Why can't I use "C:\temp\foo" in DOS paths? Why doesn't `C:\temp
\foo.exe` work?

We are not going to write your code for you when the documentation
contains both working examples and answers to frequently answered
questions.

Sinan

--
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/

Similar ThreadsPosted
Problem with recursive file/directory copy January 12, 2006, 6:14 am
File::Find doesn't go down thru directory December 13, 2007, 5:27 pm
Wierd issue with File::Find and directory May 12, 2005, 7:35 am
Using File::Find and only manipulating 1 file per directory. December 16, 2005, 10:53 am
Recursive directory removing? October 16, 2004, 6:22 pm
Recursive directory listing October 8, 2005, 7:32 pm
Recursive Directory Traversal February 14, 2006, 10:50 am
File::Find dies on directory paths which are too long March 13, 2007, 2:53 pm
Invalid top directory at d:\perl\lib\file\find.pm line 562 September 27, 2007, 5:02 am
Recursive Directory Copy (with resource forks) in Mac OS X April 2, 2008, 8:03 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap