How to tell if a file is open by another process?
Andy Crump
andyc at bucky.intel.com
Fri Nov 30 03:07:47 AEST 1990
>>>>> On 19 Nov 90 23:09:04 GMT, bunyip at 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 at littlei.intel.com
...!uunet!littlei!andyc | andyc at littlei.uu.net
Disclaimer: Any opinions expressed here are my own and
not representive of Intel Corportation.
More information about the Comp.unix.internals
mailing list