|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
C: fwrite and newlinefwrite(buffer,sizeof(char),buflen,fileptr) produces
two characters (0d, 0a) for each newline (0a) in the character buffer. My wish
is to produce constant-length output records in an efficient way. Later,
I plan to read from the file, after positioning with fseek(). What is
the recommended fix? ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ MinGW-users mailing list MinGW-users@... This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same. Most annoying abuses are: 1) Top posting 2) Thread hijacking 3) HTML/MIME encoded mail 4) Improper quoting 5) Improper trimming _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users |
|
|
Re: C: fwrite and newlineMike Deverin wrote:
> > /fwrite(buffer,sizeof(char),buflen,fileptr)/ produces two characters > (0d, 0a) for each newline (0a) in the character buffer. My wish is to > produce constant-length output records in an efficient way. Later, I > plan to read from the file, after positioning with /fseek(). /What is > the recommended fix? > fopen ("myfile", "wb"); -John E. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ MinGW-users mailing list MinGW-users@... This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same. Most annoying abuses are: 1) Top posting 2) Thread hijacking 3) HTML/MIME encoded mail 4) Improper quoting 5) Improper trimming _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users |
|
|
Re: C: fwrite and newlineOn 10/23/2009 07:34, Mike Deverin wrote:
> fwrite(buffer,sizeof(char),buflen,fileptr) produces two characters (0d, 0a) > for each newline (0a) in the character buffer. My wish is to produce > constant-length output records in an efficient way. Later, I plan to read > from the file, after positioning with fseek(). What is the recommended fix? > Hi, have you tried opening the file in binary mode? e.g. fopen("file","wb"). ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ MinGW-users mailing list MinGW-users@... This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same. Most annoying abuses are: 1) Top posting 2) Thread hijacking 3) HTML/MIME encoded mail 4) Improper quoting 5) Improper trimming _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users |
|
|
Re: C: fwrite and newlineOn Oct 22, 2009, at 6:34 PM, Mike Deverin wrote:
> fwrite(buffer,sizeof(char),buflen,fileptr) produces two characters > (0d, 0a) for each newline (0a) in the character buffer. My wish is > to produce constant-length output records in an efficient way. > Later, I plan to read from the file, after positioning with fseek(). > What is the recommended fix? If you don't need Unix compatibility, then instead of 1 for the newline, use 2 in your calculations. Or is the problem more complex than that? I guess I'm missing what the problem is... Cheers, Lloyd ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ MinGW-users mailing list MinGW-users@... This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same. Most annoying abuses are: 1) Top posting 2) Thread hijacking 3) HTML/MIME encoded mail 4) Improper quoting 5) Improper trimming _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users |
| Free embeddable forum powered by Nabble | Forum Help |