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

Has anyone had any experience using file::find on an smbmount'd drive? Here's the situation. I mount a drive in my home directory called "mp3s", so the path resolves to /home/slycer/mp3s, this is mounted on a share on my 2000 machine. Access to these files normally works (ie: "ls" returns a file listing). When I try to use file::find, it only returns a directory listing (ie, only the first level of dirs). So, thinking I had the format wrong I copied a bunch of mp3s to an actual directory (/home/slycer/test), threw them into a subdirectoy of that one (eg: /home/slycer/test/u2) and changed the code to point at the toplevel for that dir (/home/slycer/test). This built a list properly. So, I am stumped. I am hesitant to assume a bug in File::Find, but cannot find anything that states that it will not properly search smb mounted drives. I'm curious whether anyone has experienced the same behavior. This is the code, pretty basic:
use File::Find; my @mp3s; my $startdir="/home/slycer/mp3s" #/home/slycer/test find sub {push (@mp3s, $File::Find::Name) if /\.mp3/},$startdir;
Like I said, this works wonderfully if the directory is an actual non-smb mounted directory.
Thanks

Replies are listed 'Best First'.
Re: File::Find & smb mounted drive
by chipmunk (Parson) on Dec 12, 2000 at 00:02 UTC
    I tested your code on my machine (also with a mounted mp3 directory :) and had the same problem. When I stepped through with the debugger, I saw that File::Find was getting 1 for nlink instead of 2, so I tried setting $File::Find::dont_use_nlink = 1; as suggested in File::Find for AFS, and the script worked. (Also I fixed the capitalization of $File::Find::name.) Enjoy!
      ++chipmunk

      That worked perfectly.