From: Isaac Waldron Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP / 32bit <-> 16bit files r/w !? Date: Thu, 26 Mar 1998 21:42:10 -0500 Organization: The Computer Nerd Lines: 25 Message-ID: <351B1202.F9F4FAEC@lr.net> References: <351ce359 DOT 12489868 AT news DOT on-luebeck DOT de> Reply-To: waldroni AT lr DOT net NNTP-Posting-Host: plym1-6.worldpath.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk ^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/ I had this problem when I was working on my .pcx file loading routines. Namely, the height and width as encoded in the file is a 16-bit integer type, but DJGPP is 32-bits. So, what I did was I changed all the ints to shorts in DJGPP, which are 16-bit, and so worked perfectly. -- Isaac Waldron http://www.geocities.com/SiliconValley/Lakes/3574/index.html