[vorbis] Getting started with vorbisfile_example.c (MS VC 6)

Monty xiphmont at xiph.org
Thu Jun 27 14:27:49 PDT 2002



On Thu, Jun 27, 2002 at 10:52:32AM -0400, Alan MacDonald wrote:
> 
> 
> > -----Original Message-----
> > From: owner-vorbis at xiph.org [mailto:owner-vorbis at xiph.org]On Behalf Of
> > Michael Smith
> > Sent: Thursday, June 27, 2002 10:38 AM
> > To: vorbis at xiph.org
> > Subject: Re: [vorbis] Getting started with vorbisfile_example.c (MS VC
> > 6)
> >
> > >file * myfile;
> > >myfile = fopen("C:\downloads\music.ogg","r");
> >
> > This is an incredibly stupid 'feature' of DOS and windows. Use "rb" for
> > the file open mode, or reading the file does not give you the file
> > contents.
> >
> 
> What makes it even more confusing is, what you are reading will mostly look
> correct, except the carriage returns and line feeds are translated to DOS
> mode with 'r'.  'rb' disables that translation.  Maybe it might be worth it
> to add a comment to the example files on how to use fopen in windows, even
> though the examples use stdio and stdout, since this seems to come up often.

Actually, there's no reason not to have the example just use "rb".
ANSI stdio will always take the 'b' happily, it just won't do anything on
UNIX.

I'll be beefing up the example programs a bit for 1.0, and I'll add
this minor but important nigglet to the list.

Monty

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis mailing list