[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/1.5.5.1+cvs20040105i |
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): 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
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- converting to new streampos syntax ?,
Pascal A. Dupuis <=