[Top][All Lists]

[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.


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.



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]