For Programmers: Free Programming Magazines  


Home > Archive > PERL on RISC OS > June 2005 > File::Find









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author File::Find
stephane HAbeTT roux

2005-06-08, 9:04 pm

Hello,

I'm trying to use the File::Find module with port 1.13 of version 5.005

My main problem is that directory names are returned by this module,
along with file names of course. Is that the standard behaviour or
someting wrong with the RISC OS port ?

--
|":._.:"| http://habett.org/
| (=) | habett@habett.org
|\.:':./| Any one can be my master
James Taylor

2005-06-08, 9:04 pm

On Sun 15 Jun, "stephane HAbeTT roux" wrote:
>
> I'm trying to use the File::Find module with port 1.13 of version 5.005
>
> My main problem is that directory names are returned by this module,
> along with file names of course. Is that the standard behaviour or
> someting wrong with the RISC OS port ?


It is perfectly standard behaviour. If you wish to ignore
directories then simply test for them in the first line
of your "wanted()" routine like so:

find(sub {
return if -d; # Returns without doing anything if this is a directory

# Process files here

}, '/dir/to/scan');

--
James Taylor, Cheltenham, Gloucestershire, UK. PGP key: 3FBE1BF9

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com