Csound Csound-dev Csound-tekno Search About

Re: Reinit soundin

Date1997-04-30 12:03
Fromjpff@maths.bath.ac.uk
SubjectRe: Reinit soundin
Message written at 29 Apr 1997 21:23:15 +0100
--- Copy of mail to rwd@pact.srf.ac.uk ---
In-reply-to: <199704291728.SAA27745@talisker.pact.srf.ac.uk> (message from
	Richard Dobson on Tue, 29 Apr 1997 18:28:45 +0100 (BST))

Much as I dislike disagreeing with my friend Richard, ANSI C says that
fopen returns NULL if the open fails for any reason.  fopen returns a
variable of type FILE*, and any C compiler must arrange that the
result is only NULL (usually zero) when there is an error.

I think you are confusing fopen with open(2), which returns -1 for an
error, but in not an ANSI function.

On UNIX of course a file descriptor of zero is standard input, and so
would not be returned by open(2).

However Richard is correct that a file descriptor in UNIX can be zero,
and as this function only exists elsewhere as a sop to unix hackers,
it is a bug.

==John