TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Keith Fowler
from: Paul Edwards
date: 1996-03-31 15:01:28
subject: Structures and Binary

KF>     And also.. How do i open a file in BINARY mode to write to?? (if the 
KF> file 
KF> is in TRUE binary when you edit it with say, XTree Gold, it should say 
KF> something like : CANNOT EDIT NON-TEXT FILE .... I have tried:
KF>  writepoint = fopen("record.dat","wb");

That is correct.

KF>  but it just writes the file in text mode... 

No it doesn't.

KF> Any help would be appreciated!

After opening the file as above, try going fputc(0x01, writepoint);
and then close the file, and see what Xtree thinks of it then.
You see, you actually have to write some binary data to a binary
file before it starts looking like a binary file!  If you only
write printable text to a binary file, it will look just like a
text file!  BFN.  Paul.
@EOT:

---
* Origin: X (3:711/934.9)

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