Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!haven!ncifcrf!nlm-mcs!adm!xadmx!mchinni@ardec.arpa From: mchinni@ardec.arpa (Michael J. Chinni, SMCAR-CCS-E) Newsgroups: comp.unix.questions Subject: Re: Detecting type of file in a program Message-ID: <18352@adm.BRL.MIL> Date: 10 Feb 89 21:09:04 GMT Sender: news@adm.BRL.MIL Lines: 12 From: po@volta.ece.utexas.edu: > Is there a better way than using : > system("file filename > /tmp/tempfile") Better in what sense. If better than using "file" not really (for reasons mentioned by other responses). If better than using "system" and 'fpoen("/tmp/tempfile","r");' try using "popen" (i.e. popen("file filename","r"); ). Michael J. Chinni () US Army ARDEC Picatinny Arsenal, New Jersey