• Please review our updated Terms and Rules here

Hitech C question (CP/M version)

norwestrzh

Experienced Member
Joined
Jan 11, 2021
Messages
87
Location
mount vernon, wa
I just discovered that fwrite (binary I/O to a file) adds a line feed (0x0a) when it sees a carriage return (0x0D) in the stream. @:^0+ Not a very nice thing to do with binary data. Is there a fix, or work around, for this? This is version 3.09 (I think that's right?) and the last version for CP/M that I'm aware of.

Roger
 
>> Did you add a "b" to the mode parameter used in the fopen() call? ex "wb" or "wb+"

Thanks Gene. I didn't write the code, but just checked. The fopen specified "w" only. "wb" gets it working properly.

Roger
 
Back
Top