how to write binary datas in a file_(re)

Thu, 19 Sep 1996 12:52:19 +0200


At 02:18 PM 9/17/96 +0200, you wrote:
>Hi Sven, hi everybody,
>
>> I can use only the "write" function - the result is all $0A will be  
>> converted into "$0D $0A" - Yes, thats the CrLf -
>
>Yes, that's even true for "File of Integer"!  Congratulations - you
>have discovered a serious bug in the Run Time Library. :-(
>
>> I think it's no problem  
>> under UNIX, Linux, Ponyx, Limbux etc. :-)
>
>Yes, it isn't.  Your diagnostics was right.
>
>> How can I write binary datas in a file?
>> It must be work in MS-DOS !!!
>
>I'd like to fix it as soon as possible, but I am out of time right now.
>:-( :-(
>
>Anybody out there to do it?  The error must be in rts/rts-write.c,
>something with fopen() ...
>

I fixed this problem with the MS-DOS files, but it broke some the "standard"
files "Input" and "Output". I will think of something more elegant soon.
Probably change the BSD style 'fopen()' calls to 'open()' too because then I
can easily add an 

#ifdef MSDOS
flags = flags | O_BINARY;
#endif

once, instead of #iddef-ing every instance of fopen which eats "r" , "w"
arguments (which become "wb" etc for non-text files in dos & co.)

greetings,

JanJaap
--
     The latest & greates in software, hardware and manswear
                       -- Bono Vox (U2)


JanJaap van der Heijden (J.J.vanderHeijden@driene.student.utwente.nl)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es