www.digitalmars.com         C & C++   DMDScript  

c++.dos.16-bits - Re: wrong code generated by tiny program of below thread

reply "Lars Hansen" <lars.o.hansen gmx.de> writes:
 To write files in binary you need a "b" in the fopen call, as in
 fopen("rt.html","ab").

It still doesn't work as expected.
 Third, 16 bit programs cannot handle file names other
 than 8.3. "rt.html" is not a valid 16 bit filename. Try "rt.htm".

the truncation is caused by -mt, or is a tiny program already 16-bit? (thanks for the answers)
 "Lars Hansen" <lars.o.hansen gmx.de> wrote in message
 news:b2mhq8$2vp9$1 digitaldaemon.com...
 the following program compiled with sc "sourcefilename" produces a program
 which does the following:

 appends b at end of file, places b at file offset 138

 it should place b at file offset 71 and 138  (b is the char array)


Feb 16 2003
parent "Walter" <walter digitalmars.com> writes:
Don't open the file in append mode if you're going to fseek around in it..
Open it in write mode ("wb"). Also, the 8.3 filename restriction is imposed
by the 16 bit operating system. No way around it. A tiny program is 16 bit.

"Lars Hansen" <lars.o.hansen gmx.de> wrote in message
news:b2pcn7$2j4k$1 digitaldaemon.com...
 To write files in binary you need a "b" in the fopen call, as in
 fopen("rt.html","ab").

It still doesn't work as expected.
 Third, 16 bit programs cannot handle file names other
 than 8.3. "rt.html" is not a valid 16 bit filename. Try "rt.htm".

the truncation is caused by -mt, or is a tiny program already 16-bit? (thanks for the answers)
 "Lars Hansen" <lars.o.hansen gmx.de> wrote in message
 news:b2mhq8$2vp9$1 digitaldaemon.com...
 the following program compiled with sc "sourcefilename" produces a



 which does the following:

 appends b at end of file, places b at file offset 138

 it should place b at file offset 71 and 138  (b is the char array)



Feb 17 2003