From owner-freebsd-questions Sat Mar 13 8:38:58 1999 Delivered-To: freebsd-questions@freebsd.org Received: from navy.csi.cam.ac.uk (navy.csi.cam.ac.uk [131.111.8.49]) by hub.freebsd.org (Postfix) with ESMTP id 71EE414DF4 for ; Sat, 13 Mar 1999 08:38:47 -0800 (PST) (envelope-from bjc23@cam.ac.uk) Received: from bjc23.trin.cam.ac.uk ([131.111.193.197]) by navy.csi.cam.ac.uk with esmtp (Exim 2.05 #3) id 10LrQa-0002Mz-00; Sat, 13 Mar 1999 16:38:20 +0000 Received: from bjc23 by bjc23.trin.cam.ac.uk with local-esmtp (Postman Pat (and his black and white cat)) id 10LrQZ-0000Kz-00; Sat, 13 Mar 1999 16:38:19 +0000 Date: Sat, 13 Mar 1999 16:38:19 +0000 (GMT) From: "Ben J. Cohen" X-Sender: bjc23@bjc23.trin.cam.ac.uk Reply-To: bjc23@hermes.cam.ac.uk To: sporkl@ix.netcom.com Cc: questions@FreeBSD.ORG Subject: Re: Redirection of processes and of X clients In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 13 Mar 1999, Spike wrote: >> >> Firstly, is it possible to change the terminal a program is attached to >> >> while it is running? >> >I don't believe what you want is at easily feasible. A process sent to the >> >background is still attached to your terminal. What you want to do is set >> >the STDIN, STDOUT, and STDERR file descriptors to a different terminal. >> >Unless the program supports the ability to reassign its STD* file >> >descriptors, I don't think you can do this. >> >> That is basically what I want to do. >> Does the program which is being "moved" have to support the reassignment >> or is it sufficient to get another program to do it? > >I suppose you could make a program that would run a second program with >that second program's STD* file descriptors pointing at the first program, >and then the first program would wait for, SIGUSR1, or specific user >input, and then accept a filename to re-direct it's STD* file descriptors >to and therefor the second program's as well. It shouldn't be that hard to >write, but I'm not very good with C. I think I will give it a try though. >Don't expect too much. This isn't quite what I wanted, because (presumably) programs which are to support this would have to be patched. Perhaps to do this in general (i.e., without modifying applications) would need kernel-level modifications. Thanks, Ben. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message