🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.shell
3 messages
3 total messages Started by David Ellis 16-Oct-1990 1136 Tue, 16 Oct 1990 15:33
Who redirects to a file?
#1501
Author: David Ellis 16-Oct-1990 1136
Date: Tue, 16 Oct 1990 15:33
20 lines
1054 bytes
Given a specific file, how can the following be done in csh:

(a) Determine whether there exists a process whose output is currently 
redirected into the file.

(b) Same as (a), but the file is NFS-mounted with its original on another 
machine.

(c) As in (b), but you want to test for processes on other machines that
may be redirecting their output to your file via a NFS pointer on their
machine.

----
David  J  Ellis
Digital Equipment Corporation, Secure Systems Group 
Mailstop BXB1-1/D03 
85 Swanson Road, Boxboro MA 01719 
(508) 264-5073 
Usenet:   {ucbvax,allegra,decvax}!decwrl!ultra.enet!ellis
Internet: ellis@ultra.enet.dec.com
Re: Who redirects to a file?
#1504
Author: Dan Bernstein
Date: Tue, 16 Oct 1990 16:57
16 lines
1139 bytes
In article <9010161533.AA19292@decpa.pa.dec.com> ellis@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
Re: Who redirects to a file?
#1511
Author: Gary Mills
Date: Wed, 17 Oct 1990 03:02
16 lines
1015 bytes
ellis@ultra.dec.com (David Ellis 16-Oct-1990 1136) writes:

>Given a specific file, how can the following be done in csh:

>(a) Determine whether there exists a process whose output is currently 
>redirected into the file.
[...]
>(c) As in (b), but you want to test for processes on other machines that
>may be redirecting their output to your file via a NFS pointer on their
>machine.

In this situation, about all you can do is lock the file, with something
like lockf(3).  It even works across NFS mounts in SunOS 4.1.1, 
for example.
-- 
-Gary Mills-             -University of Manitoba-             -Winnipeg-
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads