[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Using "rb" vs. "r" to open gnuradio data files

From: Don Ward
Subject: Re: [Discuss-gnuradio] Using "rb" vs. "r" to open gnuradio data files
Date: Thu, 20 Mar 2008 11:44:30 -0400

Rob Walker wrote:
I was attempting to use Chuck Swiger's utility at
http://www.swigerco.com/gnuradio/raw2num_f.c to read a gnuradio file
created by audio_to_file.py but kept getting "Input reached EOF" well
before the entire file had been read.  I am not a C programmer, but
while debugging I noticed that he had used "r" in his fopen command
rather than the "rb" used by gr_file_source.cc so I made that change and
now the utility works fine.  I also noticed an old post from ematlis
l) mentioning a similar utility he'd developed and noticed it uses "r"
rather than "rb" also.  Shouldn't "rb" be used rather than "r" to open
gnuradio data files?

By the way, I am using MinGW/MSYS with GCC 3.4.5 if that matters.

Windows (MinGW/MSYS and Cygwin) needs to know when to convert the CR-LF line separators stored in a text file to LF on reading (text files) and when to leave them alone (binary data). For portability, I think that all files that are not text files should be opened with "rb".

-- Don W.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]