hrisheekesh_kale has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, I have written a script to scan entire linux filesystem using File::Find. However, the filesystem has NFS mounts and the find module traverses the NFS mount as well and therefore takes hours to complete. Can you help me with a way of specifying options for File::Find that will ignore NFS mounts so that scanning completes much faster. I am not interested in scanning NFS filesystem. On a linux system we would typically do this using the following find options - \( -fstype nfs -o -fstype autofs \) -prune I am looking for similar options in perl.
  • Comment on File::Find options to ignore NFS mounts

Replies are listed 'Best First'.
Re: File::Find options to ignore NFS mounts
by Corion (Patriarch) on Aug 02, 2016 at 11:12 UTC

    See the $File::Find::prune variable (in File::Find) and the documentation below it, which also lists the nfs case of your problem.

Re: File::Find options to ignore NFS mounts
by haukex (Archbishop) on Aug 02, 2016 at 18:43 UTC