Who redirects to a file?

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Wed Oct 17 02:57:31 AEST 1990


In article <9010161533.AA19292 at decpa.pa.dec.com> ellis at ultra.dec.com (David Ellis 16-Oct-1990 1136) writes:
> (a) Determine whether there exists a process whose output is currently 
> redirected into the file.

Remove the file and see whether any disk space clears up.

Seriously, there's no good way to get the soft link count. You could try
``ofiles'' on machines where it works, but it isn't reliable.

If there were an enforce() call to enforce the new permissions on a
file, I don't know why you'd care who had the file open. After all, if
the permissions are still open, anyone could sneak in and out of the
file at any time, so your test wouldn't be reliable. And if they aren't,
why are you checking access if you don't want to cut it off?

---Dan



More information about the Comp.unix.shell mailing list