From owner-freebsd-hackers Fri Nov 5 2:19:44 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from axl.noc.iafrica.com (axl.noc.iafrica.com [196.31.1.175]) by hub.freebsd.org (Postfix) with ESMTP id 64900158A5 for ; Fri, 5 Nov 1999 02:19:26 -0800 (PST) (envelope-from sheldonh@axl.noc.iafrica.com) Received: from sheldonh (helo=axl.noc.iafrica.com) by axl.noc.iafrica.com with local-esmtp (Exim 3.040 #1) id 11jgRp-0001ri-00; Fri, 05 Nov 1999 12:18:21 +0200 From: Sheldon Hearn To: Jos Backus Cc: Jos Backus , freebsd-hackers@freebsd.org Subject: Re: ftpd feature: lock file being stored In-reply-to: Your message of "Fri, 05 Nov 1999 11:15:18 +0100." <19991105111518.A2328@hal.mpn.cp.philips.com> Date: Fri, 05 Nov 1999 12:18:21 +0200 Message-ID: <7173.941797101@axl.noc.iafrica.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 05 Nov 1999 11:15:18 +0100, Jos Backus wrote: > > So fstat(1) doesn't show you that the file is opened to ftpd? > > No, it does indeed show that. Then use fstat. :-) > It seems a more natural solution to me than grepping for ftpd in fstat's > output regarding the file. I think you've developed a complex solution to a more simply solved problem. UNIX offers you lots of little tools for good reason. Adding functionality to ftpd that is available through other tools doesn't seem wise to me. > Also, I think that approach introduces races when > you have more than one program/script polling the directory. What does "polling the directory" mean? Fstat(1) is interested only in those programs which have open file descriptors on the file you're interested in. Sounds like the perfect tool for the job. :-) Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message