[Top][All Lists]

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

converting to new streampos syntax ?

From: Pascal A. Dupuis
Subject: converting to new streampos syntax ?
Date: Wed, 4 Feb 2004 09:24:45 -0600
User-agent: Mutt/

There was a recent change in the interface of ftell, now returning a streampos
object. How can I now perform the following operations ?

1) tell if a stream is seekable. Old way:
        cur_pos = ftell(FID);  cur_pos > -1 || error('Can''t seek');
2) push back one character onto a stream. Old way:
        fseek(FID, cur_pos - 1);

   according to the C++ standards, streampos is an object dealing with
characters streams, so going back one character should be valid.

Thanks in advance

Pascal Dupuis

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

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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