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

Alan MacDonald newslists at warpzillion.com
Thu Jun 27 07:52:32 PDT 2002



> -----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.

Something along the lines of, "If you re-implement this example using
fopen() in a WIN32 environment make sure that you use "rb" or "wb" for your
access mode to avoid carriage return and line feed translation"

<p>Alan

<p><p><p><p><p><p><p>--- >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