From owner-freebsd-questions Sun Mar 10 19: 0:14 2002 Delivered-To: freebsd-questions@freebsd.org Received: from homer.futureuse.net (c17169.randw1.nsw.optusnet.com.au [210.49.28.29]) by hub.freebsd.org (Postfix) with SMTP id 2DAD737B417 for ; Sun, 10 Mar 2002 19:00:08 -0800 (PST) Received: (qmail 10671 invoked from network); 11 Mar 2002 02:57:14 -0000 Received: from unknown (HELO futureuse.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2002 02:57:14 -0000 Received: from 203.11.225.5 (proxying for 10.140.148.30) (SquirrelMail authenticated user fbsdlist) by www.futureuse.net with HTTP; Mon, 11 Mar 2002 13:57:14 +1100 (EST) Message-ID: <24177.203.11.225.5.1015815434.squirrel@www.futureuse.net> Date: Mon, 11 Mar 2002 13:57:14 +1100 (EST) Subject: Re: Utility to list accessed files? From: "Aaron Hill" To: In-Reply-To: <20020310215346.A243@rochester.rr.com> References: <20020310215346.A243@rochester.rr.com> X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: X-Mailer: SquirrelMail (version 1.2.4) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > On Mon, Mar 11, 2002 at 01:19:58PM +1100, Aaron Hill wrote: >> Hello, >> >> I have a scripted process here that I am trying to debug. It would >> help me if I could a listing of all the files being accessed by the >> process. The scripts themselves are somewhat complex. >> >> Is there a utility available able that can do this? For example, the >> time utility ... >> >> time ls -l >> >> ... calculates how long "ls -l" takes to execute. What if I wanted a >> list of any files opened by "ls" ... can it be done? >> >> Thanks >> Aaron Hill > > ports/sysutils/lsof should do the trick. > > mike Mike, Thanks for the reply, I appreciate it. I've had a look at lsof and fstat before I sent my email. They make a list of files opened by a process at a particular point in time, so I could get a rough idea of what is going on by running the utility constantly. But say if I'm running the utility every second I could easily miss a quick access to a file. Does that sound reasonable? I was hoping for a utility that would somehow get between the application and the system calls or tie into the VFS system ... ? Maybe I'm hoping for too much. Thanks Aaron To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message