From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 10 01:08:10 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62F821065672 for ; Wed, 10 Feb 2010 01:08:10 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.210.172]) by mx1.freebsd.org (Postfix) with ESMTP id 158F98FC17 for ; Wed, 10 Feb 2010 01:08:09 +0000 (UTC) Received: by yxe2 with SMTP id 2so7173077yxe.7 for ; Tue, 09 Feb 2010 17:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=4EN4oA1NhU5+kwvH9DOrQp/ZaKdWhYSuS4K3JVLP6fo=; b=hbxpbAPUXkm091m/2K80KjjudRSw2pov4yRJsrllEOj4Z1Ni2ItotBXb60COdS9gOO 7BPQK5fT3XzqWa5DQMiZHYMUOUJcp5/zY1+SrCAjTt8i5Vwj3uYh1hh+XfYVtoTVDxWu brrF0OJeHNo9BBC/wacylxykhcUJ5kZn+fhGw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=tDLkU4hhwH2p48DcOrzbXojEw2FCWPq6skOM95lBBt4cCp4qr3EDIC42Uad4zLIB/V ogY4qW1JxSRMzuHWu1nR+ySegTBJ6ywR8nY06ba3XsxBmSJFvjYQkCi/u/bFvG8n9OXS Xm08y9j73+uzLOO9sC9/ve/BDBzzPNqgT1fDo= Received: by 10.90.40.17 with SMTP id n17mr964890agn.3.1265764089434; Tue, 09 Feb 2010 17:08:09 -0800 (PST) Received: from dhcp-173-37-1-138.cisco.com (nat.ironport.com [63.251.108.100]) by mx.google.com with ESMTPS id 14sm430867gxk.6.2010.02.09.17.08.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 09 Feb 2010 17:08:08 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: Date: Tue, 9 Feb 2010 17:08:06 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <6267ADA5-1E7A-492C-8ED2-3A1EDA4CF92C@gmail.com> References: <86tytqvwky.fsf@ds4.des.no> <26049703-8844-4476-B277-776A4EFC0A53@gmail.com> <7BE25339-9614-4E64-BA14-85291B5DE356@gmail.com> To: Andrew Brampton X-Mailer: Apple Mail (2.1077) Cc: freebsd-hackers@freebsd.org Subject: Re: sysctl with regex? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 01:08:10 -0000 On Feb 9, 2010, at 4:58 PM, Andrew Brampton wrote: > On Wed, Feb 10, 2010 at 12:51 AM, Garrett Cooper = wrote: >> fnmatch is for matching filenames... I think there's a better = way to do it with globs, but I'll have to take a quick peek at python's = glob module so I don't reinvent the wheel (using fnmatch(3) // glob(3) = to string match seems kind of stupid to do...). >>=20 >=20 > I think fnmatch() is used to match filenames but reading its > documentation I don't see why it has to be used only for filenames. It > takes a pattern and a string and returns true if they match. Having a > quick look in the FreeBSD source it is used in a few non-filesystem > places, for example, contrib/binutils/ld/ldlang.c to match section > names, sys/netinet/ipfw/ip_fw2.c to match interface names. I'm sure > there are other examples. However, if you can find a better suited > function then sure, I just don't like reinventing the wheel, even if > this wheel is the wrong colour ;) Ok.. is it the preferred bicycle wheel to equip our motorcycle with then = :]? If so I'll whip up the change in a few hours after $JOB is done. Thanks! -Garrett=