TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: ANTON SPARRIUS
from: ERIC CARMODY
date: 1995-06-09 13:16:00
subject: CHAR #10 AND GCC

AS> Ummmm...I'm writting a program with Gcc..works fine...almost :)  Act
AS> reads in a data file, manipulates it, and rewrites it. Oh, it reads 
AS> chunks....only probs is, that when it writes it out, and comes acros
AS> character 10, it puts charater 13 then 10.  (Obviously, it's turning
AS> '\n')  I have gotten around it at the moment by seeking backwards an
AS> and messy around until it works.  But, is there a better way???  I'v
AS> fprintf, fputc, fwrite...all the usuals.                            

Anton ... open the file in BINARY mode instead of the default TEXT mode.

IE... fopen("Filename.dat", "rb");


Cheers,
Eric
---
 þ RM 1.3 02837 þ 
--- PCBoard 15.2
* Origin: 32 lines 40 Gig BBS, Realtime InterNet SLIP (403)299-9900 (1:134/10)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 134/10 3615/50 396/1 270/101 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.