Mail Archives: djgpp/1998/03/27/19:15:37
On Fri, 27 Mar 1998 00:23:54 +0100, DarkSoft AT GMX DOT Net (^Hawk^ (Thorsten
Kaben)) wrote:
>Hello !
>
>I've a problem ... I've a given struct of a 16bit file where an int
>16bit is and a lon 32bit (only a 16bit file struct :) ... so far so
>good ... but how can I read / write 16bit files with DJGPP !?
>
>If I try to translate the structs and read / write the 16bit files
>then I've never the stored datas and at the writing are my created
>files always to long ... if I've a file that's 338 bytes long and I
>try to write the same file then it's 588 bytes long ... :((= ...
>
>Any hints !? What must / can I do !?
>
>Bye, ^Hawk^. http://www.bubis.com/DarkSoft/
If you want to make the source code portable between all compilers the
only safe way to write the code is to use byte read/writes and then
convert to/from ints. It is time consuming to write, but once done it
can work with big endian or little endian systems and all standard
compilers for major OS's (Unix, Win, DOS, VMS, Solaris........etc).
Andrew
- Raw text -