[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
converting to new streampos syntax ?
From: |
John W. Eaton |
Subject: |
converting to new streampos syntax ? |
Date: |
Wed, 4 Feb 2004 11:24:49 -0600 |
On 4-Feb-2004, Pascal A. Dupuis <address@hidden> wrote:
| 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');
The only comparison operators that work are == and !=.
| 2) push back one character onto a stream. Old way:
| fseek(FID, cur_pos - 1);
This should work with the current CVS sources.
| according to the C++ standards, streampos is an object dealing with
| characters streams, so going back one character should be valid.
Yes.
As for the new limitation of not being able to treat a file position
as an integer, it seems that this is likely to be a problem. If you'd
like to discuss what to do about it, please subscribe to the
octave-maintainers mailing list and pick up the discussion there.
Thanks,
jwe
-------------------------------------------------------------
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
-------------------------------------------------------------