Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: FILE *fp[]; /* is this possible? */ Message-ID: <14603@smoke.brl.mil> Date: 28 Nov 90 18:15:40 GMT References: <1990Nov27.131327.21662@agate.berkeley.edu> <1990Nov28.152146.19560@ssd.kodak.com> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 9 In article <1990Nov28.152146.19560@ssd.kodak.com> weimer@ssd.kodak.com (Gary Weimer) writes: > if ((fp[i]=fopen(file_name[i],"r+")) <= 0) > perror("Error opening file"); Please don't do this; on UNIX, perror() will report the reason for the last SYSTEM CALL failure, not the reason for failure of a library routine such as fopen(). Sometimes there is a close relation between these but at other times there is not, leading to such absurd diagnostics as "Error opening file: not a tty".