Hi madparu,
Copy the two lines of code I posted above and paste them into your script between the lines "wanted => sub {" and "return unless -f;". If you have any problems, feel free to ask (and post your code along with any error messages you may be getting).
Simply put, what the two lines do is compare the device number (see stat) of the path you are searching under to the device number of the file currently being inspected. If they don't match, meaning the file currently being inspected is on a different file system than where the search began, then the code tells File::Find not to descend into that directory by setting $File::Find::prune and to not further process the file (return).
Regards,
-- Hauke D
In reply to Re^3: Restrict file search within current filessystem using wanted subroutine
by haukex
in thread Restrict file search within current filessystem using wanted subroutine
by madparu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |