From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 13 06:58:34 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4E44016A400 for ; Wed, 13 Jun 2007 06:58:34 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id 064DE13C468 for ; Wed, 13 Jun 2007 06:58:33 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54A5FA25.dip.t-dialin.net [84.165.250.37]) by redbull.bpaserver.net (Postfix) with ESMTP id 566642E169; Wed, 13 Jun 2007 08:31:04 +0200 (CEST) Received: from webmail.leidinger.net (webmail.Leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 8E8DB5B490D; Wed, 13 Jun 2007 08:30:46 +0200 (CEST) Received: (from www@localhost) by webmail.leidinger.net (8.13.8/8.13.8/Submit) id l5D6UkaI085687; Wed, 13 Jun 2007 08:30:46 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde MIME library) with HTTP; Wed, 13 Jun 2007 08:30:46 +0200 Message-ID: <20070613083046.atl5dyq3s488s0o8@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Wed, 13 Jun 2007 08:30:46 +0200 From: Alexander Leidinger To: Garrett Cooper References: <466F86C6.7010006@u.washington.edu> In-Reply-To: <466F86C6.7010006@u.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) / FreeBSD-7.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=2.601, required 8, BAYES_50 2.50, DKIM_POLICY_SIGNSOME 0.00, RDNS_DYNAMIC 0.10) X-BPAnet-MailScanner-SpamScore: ss X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No X-Mailman-Approved-At: Wed, 13 Jun 2007 11:42:53 +0000 Cc: hackers@freebsd.org Subject: Re: Using shell commands versus C equivalents 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, 13 Jun 2007 06:58:34 -0000 Quoting Garrett Cooper (from Tue, 12 Jun 2007 22:55:18 -0700): > Another simple question (I hope): > Is there any reason why shell commands should be used in place of a > C command (in this case chmod via vsystem instead of the chmod(2) > function)? It seems like the fork / exec would be more expensive with > the shell command, but any area where code could be optimized is more > than welcome I would think. If it is just one file, I don't see the reason to use the shell command, but if you need to reinvent "chmod -R", I don't see a reason to forbid the use of the shell command (pragmatic programming). Bye, Alexander. -- Revenge is a form of nostalgia. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137