I thought this weird behaviour might be of interest to anyone working on the relevent bits of code. I haven't had time to investigate in detail or try it on a more up to date build, but if anyone is intereted, let me know and I will: $ uname -a FreeBSD pele.r.caley.org.uk 4.8-STABLE FreeBSD 4.8-STABLE #11: Tue Dec 2 18:34:40 GMT 2003 rjc@bast.r.caley.org.uk:/usr/obj/usr/src/sys/Pele i386 $ find /cdrom -name \*.mp3 | wc 49 49 3387 $ find /cdrom -name \*.mp3 -type f | wc 77 77 5214 Ie adding an extra restriction increases the number of results. The first one isn't giving an error at the point where it stops. /cdrom is mounting a CD burnt on FBSD. It was created with mkisofs with the arguments '-r -T -J'. I believe it was all one session. The first command's results seem to be all and only the ones in the first N sub-directories (actually one level down, not in the root of the CD), but the next one does not seems to be weird in any way (not a very long name, not a name which clashed with another and got substituted). -- rjc@interactive.co.uk _O_ |<
On Fri, Jun 04, 2004 at 09:06:30AM +0100, Richard Caley wrote:> Ie adding an extra restriction increases the number of results. The > first one isn't giving an error at the point where it stops.I think find uses an optimisation to determine if a directory has subdirectories by checking the link count. This works on UFS but not on some other file systems, so you could somehow be tripping up on this (if find has to stat all the files it will definitely know if there are subdirectories). I think this has been fixed in -current. David.
On Fri, Jun 04, 2004 at 09:06:30AM +0100, Richard Caley wrote:> $ uname -a > FreeBSD pele.r.caley.org.uk 4.8-STABLE FreeBSD 4.8-STABLE #11: Tue Dec 2 18:34:40 GMT 2003 rjc@bast.r.caley.org.uk:/usr/obj/usr/src/sys/Pele i386 > > $ find /cdrom -name \*.mp3 | wc > 49 49 3387 > > $ find /cdrom -name \*.mp3 -type f | wc > 77 77 5214 > > Ie adding an extra restriction increases the number of results. The > first one isn't giving an error at the point where it stops.Can you send the output of them without the |wc ? Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/
Can some one point me in the right direction for setting up a simple Samba sever for a home network. It sits snugly behind a FreeBSD firewall So I am not terribly concerned with security for the Samba server. Basically The setup I want is to have all my windows system be able to write to a /usr/samba file system I set up. Thank you Bill
From: "William Woods" <wwoods@cybcon.com>> Can some one point me in the right direction for setting up a simple Samba > sever for a home network. It sits snugly behind a FreeBSD firewall So I am > not terribly concerned with security for the Samba server. Basically The > setup I want is to have all my windows system be able to write to a > /usr/samba file system I set up.encrypt passwords = yes This line could be usefull to unquote in smb.conf, no need to XP registry mods after this. Also add users smb passwords with smbpasswd.
On Sun, Jun 06, 2004 at 08:39:17AM -0400, William Woods wrote:> Can some one point me in the right direction for setting up a simple Samba > sever for a home network. It sits snugly behind a FreeBSD firewall So I am > not terribly concerned with security for the Samba server. Basically The > setup I want is to have all my windows system be able to write to a > /usr/samba file system I set up.You might consider installing samba from ports and then edit the example /usr/local/etc/smb.conf.default as smb.conf. It usually comes with some good example entries that imho are easy to understand and tweak according to your likening. => cd /usr/ports/net/samba (for 2.2.9) cd /usr/ports/net/samba-devel (for 3.0.4) make package Then have a look at /usr/local/etc/rc.d/samba.sh, ie rename samba.sh.sample to samba.sh so samba will be started on system boot. man smb.conf man smbd man nmbd are also quite helpful. Regards, Holger Kipp
At 9:06 AM +0100 6/4/04, Richard Caley wrote:>I thought this weird behaviour might be of interest to anyone >working on the relevent bits of code. ... > > $ find /cdrom -name \*.mp3 | wc > 49 49 3387 > > $ find /cdrom -name \*.mp3 -type f | wc > 77 77 5214 > >Ie adding an extra restriction increases the number of results. >The first one isn't giving an error at the point where it stops.This is almost certainly an optimization in `find', where it expects that the link-count for a directory is equal to the number of sub-directories + 2. The +2 is assumed to be '.' and '..'. But some file systems do not really have links for '.' and '..'. What happens is that something in `find' believes that once it has found "link-count - 2" directories, than it must have found all the real sub-directories in that directory. By making this assumption, it can avoid of doing a lot of unnecessary stat() calls. But on file systems which do *not* have links for '.' and '..', this will result in `find' skipping the last two real sub-directories -- without thinking that any error has occurred. By adding the extra restriction, `find' *must* do the extra stat() calls anyway, so it can not perform this optimization. Note that in some situations, this optimization can result in a pretty significant performance boost, so it is worth doing (when it works correctly... :-). I know this problem shows up on some CD-ROM file systems, but I don't know if it happens on all of them. I also haven't looked into `find' specifically, but I know I ran into this on some other programs which perform this optimization. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu
[moved to -questions, please honour MFT] * William Woods <wwoods@cybcon.com> [20040606 14:39]:> Can some one point me in the right direction for setting up a simple Samba > sever for a home network. It sits snugly behind a FreeBSD firewall So I am > not terribly concerned with security for the Samba server. Basically The > setup I want is to have all my windows system be able to write to a > /usr/samba file system I set up.1.- install the net/samba-devel (no need for ACL/LDAP/CUPS...) 2.- Glance at the official samba HOWTO found at the samba site. For a quick start look at http://se.samba.org/samba/docs/man/howto/FastStart.html#id2509120 qvb -- pica