[Gllug] Off Topic: C File Descriptors

Alain Williams addw at phcomp.co.uk
Thu Mar 6 23:15:26 UTC 2008


On Tue, Mar 04, 2008 at 12:10:02PM +0000, Mick Farmer wrote:
> Dear GLLUGers,
> 
> Is there a way of determining whether standard output and
> standard error are going to the same file/device?

use fstat() & compare st_dev and st_ino

-- 
Alain Williams
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
Chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h>
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list