octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[help-octave] Re: converting to new streampos syntax ?]


From: Pascal A. Dupuis
Subject: [help-octave] Re: converting to new streampos syntax ?]
Date: Fri, 6 Feb 2004 10:47:37 +0100
User-agent: Mutt/1.5.5.1+cvs20040105i

On Wed, Feb 04, 2004 at 11:24:49AM -0600, John W. Eaton wrote:
> | 1) tell if a stream is seekable. Old way:
> |     cur_pos = ftell(FID);  cur_pos > -1 || error('Can''t seek');
> 
> The only comparison operators that work are == and !=.
The right, backward compatible way:
cur_pos != -1 || error('my_fscanf: stream is not seekable');
> 
> | 2) push back one character onto a stream. Old way:
> |     fseek(FID, cur_pos - 1);
> 
> This should work with the current CVS sources.
It works with 2.1.53

This leaves another question open: the help and info pages don't say anything
about ftell return value. Is it something like the C counterpart, 0=succes,
non-zero = failure ?

Best regards

Pascal Dupuis

-- 
Dr. ir. Pascal Dupuis
K. U. Leuven, ESAT/ELECTA (formerly ELEN):  http://www.esat.kuleuven.ac.be/
Kasteelpark Arenberg, 10; B-3001 Leuven-Heverlee, Belgium
Tel. +32-16-32 10 21 -- Fax +32-16-32 19 85



reply via email to

[Prev in Thread] Current Thread [Next in Thread]