From owner-freebsd-stable Tue Mar 23 4:58: 0 1999 Delivered-To: freebsd-stable@freebsd.org Received: from wins0.win.org (WinS0.win.org [204.184.50.200]) by hub.freebsd.org (Postfix) with ESMTP id 480D214C32 for ; Tue, 23 Mar 1999 04:57:58 -0800 (PST) (envelope-from jase@clearsail.net) Received: from clearsail.net (win-pd-cs1-13.win.org [204.184.50.61]) by wins0.win.org (8.9.1a/8.9.1) with ESMTP id GAA15814; Tue, 23 Mar 1999 06:57:31 -0600 (CST) Message-ID: <36F78FD9.9143B702@clearsail.net> Date: Tue, 23 Mar 1999 06:58:01 -0600 From: Jason McNew X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 3.1-STABLE i386) X-Accept-Language: ja MIME-Version: 1.0 To: Dom Mitchell Cc: stable@freebsd.org Subject: Re: Perl File::Find problem References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dom Mitchell wrote: > On 23 March 1999, Jason McNew proclaimed: > > I'm trying to use the File::Find module in Perl 5 and for some reason it > > refuses to search through my fat32 mouted dirs. Observe the folowing > > code: > > > > use File::Find; > > &find(\&ismp3, '/d','/c','/usr/home'); > > > > sub ismp3 { > > if(/mp3/i) { push @mp3list, $File:Find:name; } > > } > > > > It works exactly as expect but only under /usr/home. It quietly skips > > over /c and /d which are both fat32 partitions. After removing the > > '/usr/home' for testing, I found that it claims to have searched /c and > > /d in under .2 seconds, when using `find /c` as I used to do usually > > takes a full 80 seconds. > > I checked to make sure that they are in fact mounted; they are. I'm not > > sure if it's aproblem with the module it's self or in the way it > > interacts with the os. I'm running FreeBSD 3.0-stable CVSup'ed about 3 > > days ago and using the version of perl compiled with it (5.002_02). Any > > ideas? > > Try running the whole thing under ktrace(1) to see what's really going > on. Off the top of my head, it may be the same problem that find used > to have on older Unix systems, where it didn't like cd9660 filesystems, > because the link count on the directory was wrong. It's been such a > long time since I've looked inside a FAT filesystem, that I have no > ideas whether or not this would be the case. > -- Yes, that's it. lstat is returing 1 as the nlink count any directory, and the module uses $subdirs = $nlink - 2 then thinks there are no subdirs because $subdirs = -1. The fix is to define $File::Find::dont_use_nlink as the pod suggests if your using AFS. I have no idea what AFS is, but defining that works. I should probably notify the perl people though. Thanks for the tip. :) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message