Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Beginners guide to File::Find

by Anonymous Monk
on Mar 10, 2005 at 14:55 UTC ( #438273=note: print w/replies, xml ) Need Help??


in reply to Beginners guide to File::Find

This looked promising but the examples don't work on win32. Or I'm probably doing something else wrong.

Replies are listed 'Best First'.
Re^2: Beginners guide to File::Find
by dwhite20899 (Friar) on Aug 07, 2005 at 00:50 UTC
    If I have a need to process all of the files in a directory tree, I use find2perl to generate a template. If you are familiar with the *ix find command, there are several options you can use to your advantage, but I usually stick to find2perl / -type f -print > template.pl . You can substitute any starting directory instead of / to suit, and the -type f will limit the code to files.

    You should end up with this subroutine:

    sub wanted { my ($dev,$ino,$mode,$nlink,$uid,$gid); (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ && print("$name\n"); }

    I replace the print("$name\n") with my code that performs an action on every file.

      Does anyone know how to get the return value for find ? There is no documentation or any discussion on it

        According to the source, the find function does not have a (meaningful) return value.

Re^2: Beginners guide to File::Find
by sekitan (Beadle) on Mar 11, 2005 at 23:39 UTC
    Dear anonymous monk, I can assure you that these fine examples do work on Win32. Don't give up on File::Find, it makes life better.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://438273]
help
Chatterbox?
Discipulus is going mad with the new win10 client.. tried mv Cortana /dev/null but no succes
[Corion]: Ouch - another pretrained set is available, using images from IMDB and Wikipedia. So I expect interesting results for non-PR images where people are pictured that are not made up
[Corion]: Discipulus: Yeah, from my investigations, you can somewhat silence+disable Cortana, but some services of it remain always running unfortunately. What a waste of resources :-/
[Corion]: I hope you had a good weekend still ;)
choroba had a workshop with the band
[choroba]: which counts as a good weekend
[Discipulus]: yes, (at least until Sun afternoon...): Saturday we got splendid birthday party in a park: lot of eat, drink and children amusement: bag running, magnetic fishing, rope and that big pot full of candies to smash with a club

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2017-09-25 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (277 votes). Check out past polls.

    Notices?