From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 12 11:06:48 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AF38516A412; Tue, 12 Sep 2006 11:06:48 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E5C143D58; Tue, 12 Sep 2006 11:06:44 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (hkjofy@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k8CB6b9t088487; Tue, 12 Sep 2006 13:06:42 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k8CB6bwD088486; Tue, 12 Sep 2006 13:06:37 +0200 (CEST) (envelope-from olli) Date: Tue, 12 Sep 2006 13:06:37 +0200 (CEST) Message-Id: <200609121106.k8CB6bwD088486@lurza.secnetix.de> From: Oliver Fromme To: uberlord@gentoo.org, ssedov@mbsd.msk.ru, freebsd-hackers@freebsd.org, freebsd-standards@freebsd.org In-Reply-To: <200609112129.40199.uberlord@gentoo.org> X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 12 Sep 2006 13:06:43 +0200 (CEST) X-Mailman-Approved-At: Tue, 12 Sep 2006 11:28:15 +0000 Cc: Subject: Re: FreeBSD Port: sysutils/fuser 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: Tue, 12 Sep 2006 11:06:48 -0000 Roy Marples wrote: > Stanislav Sedov wrote: > > But they wants the value 0 to be returned in case of no errors, and > > since there are no errors in case of no files opened on mountpoint, > > returning non-zero could break some apps that relies on POSIX > > functionality. > > > > IIRC, solaris resembles the same behavior. > > OK, you win - I'll parse the output :) There's no need to parse it. If you only want to know if _any_ process is accessing a file at all, it's sufficient to check if stdout from fuser is non-empty. In shell- script syntax: if [ -n "`fuser -f whatever 2>/dev/null`" ]; then echo "File is being accessed." fi Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "anyone new to programming should be kept as far from C++ as possible; actually showing the stuff should be considered a criminal offence" -- Jacek Generowicz