Steve <> wrote:
>It seems that the return values of fseek() and ftell() are undefined for
>non-seekable devices. So is there any way to test whether a stream is
>seekable?
The return values of fseek and ftell are well defined:
fseek() returns nonzero for a request that cannot be satisfied.
ftell() function returns -1L on failure and stores an implementation-
defined positive value in errno.
You may use these to determine if you can set/get the file position
indicator for a stream.
Regards
--
Irrwahn
()
|