Mail Archives: cygwin/1998/06/17/08:57:05
On Mon, 15 Jun 1998, Christopher Donham wrote:
> Hi all,
> A quick question. I seem to be having trouble getting
> fseek to work. For some reason after about 900 bytes,
> fseek ceases to go to the correct point in the file.
It is a usual problem. Your problem is really simple and the solution is
simple too. In fact, when you open your file with fopen(), it is open by
default in TEXT mode. Such mode does not exist under Unix, only under DOS
and Windows. This problem is not related to GNU-Win32 (I already get the
same problem with BC4 under DOS). I understand that the problem seems to
come from nowhere at first...
Solution: Use fopen("file","rb"); to specify explicitely BINARY mode.
You know, this problem is so common that I discover it in my own source
code yesterday. I'm working most of my time in a Unix environnement and we
don't take care about such silly errors. But we can wonder why Microsoft
OS support this silly TEXT mode.
Hope it helps.
Benoit Papillault
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -