Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!ogicse!littlei!gandalf!andyc From: andyc@bucky.intel.com (Andy Crump) Newsgroups: comp.unix.internals Subject: Re: How to tell if a file is open by another process? Message-ID: Date: 29 Nov 90 16:07:47 GMT References: <1990Nov19.230904.11056@world.std.com> Sender: news@littlei.UUCP Organization: Intel Corporation, Hillsboro, Oregon Lines: 28 In-reply-to: bunyip@world.std.com's message of 19 Nov 90 23:09:04 GMT >>>>> On 19 Nov 90 23:09:04 GMT, bunyip@world.std.com (Jason W May) said: Jason> I am trying to figure out how to determine if an existing file is Jason> already open by another process (over which I have no control). Jason> In this case, the other process is the ftp daemon: I am watching Jason> a particular directory for files to appear, and I want to be able Jason> to tell if an incoming file has been completely transferred. Jason> Is there a way to do this, besides watching to see if the file size Jason> changes? In System V Release 4.0, there is a utility called fuser. It takes a file/directory as a parameter and returns a list of process ids (and optionally the login id) of the processes that have that file/directory open. There is also a public domain program called ofiles that does something similar. Check the usenet archives. Maybe someone knows just where ofiles can be found. -- -- Andy Crump ...!tektronix!reed!littlei!andyc | andyc@littlei.intel.com ...!uunet!littlei!andyc | andyc@littlei.uu.net Disclaimer: Any opinions expressed here are my own and not representive of Intel Corportation.