Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Nov 2011 21:48:05 +0000
From:      Alexander Best <arundel@freebsd.org>
To:        freebsd-hackers@FreeBSD.org
Subject:   Re: easy way to determine if a stream or fd is seekable
Message-ID:  <20111117214805.GA96937@freebsd.org>
In-Reply-To: <20111117175514.274040@gmx.com>
References:  <20111117175514.274040@gmx.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu Nov 17 11, Dieter BSD wrote:
> > lseek() on a tape drive does not return an error, nor does it
> > actually do anything.
> 
> IIRC some tape drives can seek, while others cannot.
> Vague memories that it is supposed to be possible to put a
> filesystem on a DECtape and mount the filesystem.

or how about the following:

1) if the file argument we're seeking on is a tape drive, just do a regular
   seek operation.
2) afterwards use ftell() to verify that the seek REALLY happend. if it didn't,
   return -1 and set errno = EBADF.

cheers.
alex

> 
> It might be that FreeBSD doesn't currently support seeking
> on a tape, but we shouldn't paint ourselves into a corner
> by assuming that it is fundimentally impossible.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111117214805.GA96937>