Csound Csound-dev Csound-tekno Search About

Re: Reinit soundin

Date1997-05-01 09:51
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

Date1997-05-07 18:16
FromRichard Dobson
SubjectRe: Reinit soundin
Yup, smack on wrist for me - as soon as I looked at the code I found what
I meant to say - comes from writing replies too quickly without using a brain.
Anyway, the actual problem with soundin was not the file descriptor, but that
the file pointer was not being reset to the start of the sound. I have sent a
simple fix to John Fitch, which I think has gone out in the new release. I am
not at all sure it is a complete fix, but it does restart the sound as
required, so everyone can now do 'N-N-N-Nineteen' imitations in Csound.

Richard Dobson