From: Mikael A. <mik...@te...> - 2004-03-31 06:42:07
|
Ooops, sorry, I mean "wb" for binary mode of course... Mikael ----- Original Message -----=20 From: "Stefan Viljoen" <ry...@in...> To: <min...@li...> Sent: Wednesday, March 31, 2004 8:25 AM Subject: [Mingw-users] Mingw fwrite size problem > Mikael Aronsson wrote: > > Message: 2 > From: "Mikael Aronsson" <mik...@te...> > To: <min...@li...> > Subject: Re: [Mingw-users] Fwrite/fread under Windows not able to save same > sizes as in Linux? > > Windows has "text" mode that replaces crlf and so on and this may be on= b=3D > y > default, this also > handles EOF characters as end of file, so if you have a file in text mo= de > and write and end of > file, that would be handled as an end of file. > > Use fopen( ...., "wt"); instead of fopen( ..., "w"); and so on. > > Hi Mikael > > Hmm - not sure I understand you correctly. If I save the data buffer us= ing > "wt" and the problem goes away, i. e. that the resultant file is now th= e full > 6 meg and not 0 anymore, won;t using text saving mode corrupt the data?= I. e. > either because CR/LF is not included, the data will be invalid, or when= I try > to fread with "wt" it stops at wat LOOKS to it like an eof but is, in fact, > data I want loaded? > > Or am I missing the point here? > > Sorry, I am a relative newbie to C and MingW and programming in general= . > > Thanks for taking the time to reply! > > Regards, > > --=20 > Stefan Viljoen > Polar Design Solutions > Software Support Technician > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=CCk > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users |