Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exclude directories using File::Find::dir

Status
Not open for further replies.

blarneyme

MIS
Jun 22, 2009
160
0
0
US
I'm using File::Find::dir to find a particular file that may exist on a server, however, there are NFS mounts that I need to exclude.

This is the pertinent section of my code.
Code:
        find(sub {
                if ($_ =~ /myfile$/) {
                        push(@files, [$File::Find::dir . "/$_", (stat($_))[7]]);
                }
        }, "/");
 
You could parse the NFS mounts out of the mount -v command output and add some logic to exclude them...

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top