Detecting type of file in a program

Michael J. Chinni, SMCAR-CCS-E mchinni at ardec.arpa
Sat Feb 11 07:09:04 AEST 1989


From: po at 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 (<mchinni at ardec.arpa>)
	US Army ARDEC
	Picatinny Arsenal, New Jersey  



More information about the Comp.unix.questions mailing list