delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/24/09:38:03

Date: Wed, 24 Jan 1996 16:19:23 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Andrea Tasso <andrea DOT tasso AT galactica DOT it>
Cc: djgpp AT delorie DOT com
Subject: Re: problem with fseek, macro SEEK_CUR does not work

On Tue, 23 Jan 1996, Andrea Tasso wrote:

> The output is:
> 
> 1
> 
> 
> While I expected to see
> 1
> 3
> 
> That is what I see if I write
> 
> fseek ( fp , +2 , SEEK_SET ) ;
> 
> The problem remains also if I open the file in text mode; I tried to open it 
> in binary mode because I read in djgpp documentation that fseek doesn't work 
> properly with DOS in text mode (no one-to-one correspondence chars-bytes).
> I am afraid the problem is pesent also in binary mode, isn't it ?

Your test program works for me as you'd expect: it prints 1 and 3.  Which
version of DJGPP do you use?  What happens if you replace SEEK_CUR with 1?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019