[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mingw-users
Subject:    Re: [Mingw-users] Mingw fwrite size problem
From:       "Mikael Aronsson" <mikael-aronsson () telia ! com>
Date:       2004-03-31 6:41:57
Message-ID: 00c301c416eb$4423a990$bf95d1d9 () PC128
[Download RAW message or body]

Ooops, sorry, I mean "wb" for binary mode of course...

Mikael

----- Original Message ----- 
From: "Stefan Viljoen" <rylan@intekom.co.za>
To: <mingw-users@lists.sourceforge.net>
Sent: Wednesday, March 31, 2004 8:25 AM
Subject: [Mingw-users] Mingw fwrite size problem


> Mikael Aronsson wrote:
>
> Message: 2
> From: "Mikael Aronsson" <mikael-aronsson@telia.com>
> To: <mingw-users@lists.sourceforge.net>
> 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=
> y
> default, this also
> handles EOF characters as end of file, so if you have a file in text mode
> 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 using
> "wt" and the problem goes away, i. e. that the resultant file is now the
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,
>
> -- 
> 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_id70&alloc_id638&opĚk
> _______________________________________________
> MinGW-users mailing list
> MinGW-users@lists.sourceforge.net
>
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users



-------------------------------------------------------
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_id70&alloc_id638&opĚk
_______________________________________________
MinGW-users mailing list
MinGW-users@lists.sourceforge.net

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic