Re: easy way to determine if a stream or fd is seekable

2011-12-10 Thread Cesar Casas
??? U0drc0lHeHZjblJ0YjNKeWFYTWdaRzhnYjNWcElHSmhZMnNnV0VRdUlGTnZMQ0JwSUhkeWFYUmxa Q0JoSUc1bGR5QmxlSEJzYjJsMApMQ0IyWlhKNUlHVmhjM2t1SUVWNGNHeHZkR2x1WnlCaElHWmhZ MlZpYjI5cklHSjFaeUJwYmlCc2IyZHBiaUJ3Y205alpYTnpMQ0JwCklHUnBjMk52ZG1WeWVTQmhJ R05vWldOcklHbHVkRzhnWVdwaGVDQndjbTlqWlhOekxpQlRieXdnYldWaFlua2dl

Re: easy way to determine if a stream or fd is seekable

2011-11-22 Thread Alexander Best
On Mon Nov 21 11, Benjamin Kaduk wrote: > On Mon, 21 Nov 2011, Alexander Best wrote: > > >On Mon Nov 21 11, Alexander Best wrote: > >>On Mon Nov 21 11, Benjamin Kaduk wrote: > >>>On Mon, 21 Nov 2011, per...@pluto.rain.com wrote: > >>> > Alexander Best wrote: > > >here's a revised pat

Re: easy way to determine if a stream or fd is seekable

2011-11-21 Thread Benjamin Kaduk
On Mon, 21 Nov 2011, Alexander Best wrote: On Mon Nov 21 11, Alexander Best wrote: On Mon Nov 21 11, Benjamin Kaduk wrote: On Mon, 21 Nov 2011, per...@pluto.rain.com wrote: Alexander Best wrote: here's a revised patch. ... +.Sh CAVEATS +If the +.Fn lseek +system call is operating on a dev

Re: easy way to determine if a stream or fd is seekable

2011-11-21 Thread Alexander Best
On Mon Nov 21 11, Alexander Best wrote: > On Mon Nov 21 11, Benjamin Kaduk wrote: > > On Mon, 21 Nov 2011, per...@pluto.rain.com wrote: > > > > >Alexander Best wrote: > > > > > >>here's a revised patch. > > >>... > > >>+.Sh CAVEATS > > >>+If the > > >>+.Fn lseek > > >>+system call is operating on

Re: easy way to determine if a stream or fd is seekable

2011-11-21 Thread Alexander Best
On Mon Nov 21 11, Benjamin Kaduk wrote: > On Mon, 21 Nov 2011, per...@pluto.rain.com wrote: > > >Alexander Best wrote: > > > >>here's a revised patch. > >>... > >>+.Sh CAVEATS > >>+If the > >>+.Fn lseek > >>+system call is operating on a device, which is incapable of seeking, > >>+it will request

Re: easy way to determine if a stream or fd is seekable

2011-11-20 Thread Benjamin Kaduk
On Mon, 21 Nov 2011, per...@pluto.rain.com wrote: Alexander Best wrote: here's a revised patch. ... +.Sh CAVEATS +If the +.Fn lseek +system call is operating on a device, which is incapable of seeking, +it will request the seek operation and complete successfully. I think it would be better

Re: easy way to determine if a stream or fd is seekable

2011-11-20 Thread Ramanjaneyulu Talla
On 21/11/11 5:45 PM, "per...@pluto.rain.com" wrote: >Alexander Best wrote: > >> here's a revised patch. >> ... >> +.Sh CAVEATS >> +If the >> +.Fn lseek >> +system call is operating on a device, which is incapable of seeking, >> +it will request the seek operation and complete successfully. > >

Re: easy way to determine if a stream or fd is seekable

2011-11-20 Thread perryh
Alexander Best wrote: > here's a revised patch. > ... > +.Sh CAVEATS > +If the > +.Fn lseek > +system call is operating on a device, which is incapable of seeking, > +it will request the seek operation and complete successfully. I think it would be better without the first comma (after "device")

Re: easy way to determine if a stream or fd is seekable

2011-11-20 Thread Alexander Best
On Sun Nov 20 11, Dieter BSD wrote: > > something like the following inside lseek() would take care of tape drives: > > > >        if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { > >                if (ioctl(io->fd, FIODTYPE, &type) == -1) > >                        err(1, "%s", io->name); > > >

Re: easy way to determine if a stream or fd is seekable

2011-11-20 Thread Dieter BSD
> something like the following inside lseek() would take care of tape drives: > >        if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { >                if (ioctl(io->fd, FIODTYPE, &type) == -1) >                        err(1, "%s", io->name); > >                if (type & D_TAPE) >            

Re: easy way to determine if a stream or fd is seekable

2011-11-20 Thread Alexander Best
On Sat Nov 19 11, Tim Kientzle wrote: > > On Nov 18, 2011, at 12:31 PM, Alexander Best wrote: > > > On Fri Nov 18 11, Tim Kientzle wrote: > >> > >> Take a look at > >> > >> http://libarchive.googlecode.com/svn/trunk/libarchive/archive_read_open_filename.c > >> > >> Especially the comments abo

Re: easy way to determine if a stream or fd is seekable

2011-11-20 Thread Alexander Best
On Sun Nov 20 11, Alexander Best wrote: > On Sun Nov 20 11, Alexander Best wrote: > > On Sat Nov 19 11, Tim Kientzle wrote: > > > > > > On Nov 18, 2011, at 12:31 PM, Alexander Best wrote: > > > > > > > On Fri Nov 18 11, Tim Kientzle wrote: > > > >> [snip] > > so...any thoughts regarding this

Re: easy way to determine if a stream or fd is seekable

2011-11-20 Thread Alexander Best
On Sun Nov 20 11, Alexander Best wrote: > On Sat Nov 19 11, Tim Kientzle wrote: > > > > On Nov 18, 2011, at 12:31 PM, Alexander Best wrote: > > > > > On Fri Nov 18 11, Tim Kientzle wrote: > > >> > > >> Take a look at > > >> > > >> http://libarchive.googlecode.com/svn/trunk/libarchive/archive_r

Re: easy way to determine if a stream or fd is seekable

2011-11-20 Thread Alexander Best
On Sat Nov 19 11, Tim Kientzle wrote: > > On Nov 18, 2011, at 12:31 PM, Alexander Best wrote: > > > On Fri Nov 18 11, Tim Kientzle wrote: > >> > >> Take a look at > >> > >> http://libarchive.googlecode.com/svn/trunk/libarchive/archive_read_open_filename.c > >> > >> Especially the comments abo

Re: easy way to determine if a stream or fd is seekable

2011-11-19 Thread Tim Kientzle
On Nov 18, 2011, at 12:31 PM, Alexander Best wrote: > On Fri Nov 18 11, Tim Kientzle wrote: >> >> Take a look at >> >> http://libarchive.googlecode.com/svn/trunk/libarchive/archive_read_open_filename.c >> >> Especially the comments about detecting "disk-like" devices. >> I rewrote a bunch of

Re: easy way to determine if a stream or fd is seekable

2011-11-19 Thread Tim Kientzle
On Nov 18, 2011, at 2:10 PM, Juergen Lock wrote: > On Fri, Nov 18, 2011 at 12:00:07PM -0800, Tim Kientzle wrote: >> >> On Nov 17, 2011, at 12:55 PM, Juergen Lock wrote: >> After a few experiments, bsdtar stopped using lseek() on FreeBSD for anything other than regular files and

Re: easy way to determine if a stream or fd is seekable

2011-11-18 Thread Juergen Lock
On Fri, Nov 18, 2011 at 12:00:07PM -0800, Tim Kientzle wrote: > > On Nov 17, 2011, at 12:55 PM, Juergen Lock wrote: > > >> > >> After a few experiments, bsdtar stopped using lseek() on > >> FreeBSD for anything other than regular files and block > >> devices. I believe there are other things t

Re: easy way to determine if a stream or fd is seekable

2011-11-18 Thread Alexander Best
On Fri Nov 18 11, Alexander Best wrote: > On Fri Nov 18 11, Tim Kientzle wrote: > > On Nov 17, 2011, at 1:48 PM, Alexander Best wrote: > > > > > On Thu Nov 17 11, Dieter BSD wrote: > > >>> lseek() on a tape drive does not return an error, nor does it > > >>> actually do anything. > > >> > > >> II

Re: easy way to determine if a stream or fd is seekable

2011-11-18 Thread Alexander Best
On Fri Nov 18 11, Tim Kientzle wrote: > On Nov 17, 2011, at 1:48 PM, Alexander Best wrote: > > > 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. > >>

Re: easy way to determine if a stream or fd is seekable

2011-11-18 Thread Tim Kientzle
On Nov 17, 2011, at 1:48 PM, Alexander Best wrote: > 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 p

Re: easy way to determine if a stream or fd is seekable

2011-11-18 Thread Alexander Best
On Fri Nov 18 11, Tim Kientzle wrote: > > On Nov 17, 2011, at 12:55 PM, Juergen Lock wrote: > > >> > >> After a few experiments, bsdtar stopped using lseek() on > >> FreeBSD for anything other than regular files and block > >> devices. I believe there are other things that do support > >> seek

Re: easy way to determine if a stream or fd is seekable

2011-11-18 Thread Tim Kientzle
On Nov 17, 2011, at 12:55 PM, Juergen Lock wrote: >> >> After a few experiments, bsdtar stopped using lseek() on >> FreeBSD for anything other than regular files and block >> devices. I believe there are other things that do support >> seeking, but I don't believe there is an accurate mechanis

Re: easy way to determine if a stream or fd is seekable

2011-11-18 Thread David Brodbeck
On Fri, Nov 18, 2011 at 4:13 AM, Stefan Esser wrote: > I have no idea, whether tape drives are still in wide use. For the > purposes that I administrated and used tapes for (gamma/particle > coincidence spectroscopy and large numerical simulations), large disk > arrays have completely replaced ta

Re: easy way to determine if a stream or fd is seekable

2011-11-18 Thread Stefan Esser
Am 18.11.2011 06:00, schrieb per...@pluto.rain.com: > "Dieter BSD" wrote: >> 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. > > Back in the Bell Labs 6th Edition days, it was p

Re: easy way to determine if a stream or fd is seekable

2011-11-17 Thread Juergen Lock
In article you write: >On Nov 16, 2011, at 4:24 PM, Alexander Best wrote: > >> On Thu Nov 17 11, Joerg Sonnenberger wrote: >>> On Wed, Nov 16, 2011 at 01:14:28PM +, Alexander Best wrote: On Wed Nov 16 11, Joerg Sonnenberger wrote: > On Tue, Nov 15, 2011 at 08:24:50PM +, Alexander

Re: easy way to determine if a stream or fd is seekable

2011-11-17 Thread perryh
"Dieter BSD" wrote: > 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. Back in the Bell Labs 6th Edition days, it was possible to put a filesystem on a _9-track magtape_ and mount

Re: easy way to determine if a stream or fd is seekable

2011-11-17 Thread perryh
Alexander Best wrote: > since i've never worked with tape: what file type does it identify > as? character special file, or block special file, or ...? IIUC all devices are now character, block devices having been dropped from FreeBSD some time ago. Come to think of it, it would not be altoget

Re: easy way to determine if a stream or fd is seekable

2011-11-17 Thread Alexander Best
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.

Re: easy way to determine if a stream or fd is seekable

2011-11-17 Thread Alexander Best
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.

Re: easy way to determine if a stream or fd is seekable

2011-11-17 Thread Dieter BSD
> 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. It might be that FreeBSD doesn't currently supp

Re: easy way to determine if a stream or fd is seekable

2011-11-17 Thread Alexander Best
On Wed Nov 16 11, Tim Kientzle wrote: > > On Nov 16, 2011, at 4:24 PM, Alexander Best wrote: > > > On Thu Nov 17 11, Joerg Sonnenberger wrote: > >> On Wed, Nov 16, 2011 at 01:14:28PM +, Alexander Best wrote: > >>> On Wed Nov 16 11, Joerg Sonnenberger wrote: > On Tue, Nov 15, 2011 at 08:2

Re: easy way to determine if a stream or fd is seekable

2011-11-16 Thread Tim Kientzle
On Nov 16, 2011, at 4:24 PM, Alexander Best wrote: > On Thu Nov 17 11, Joerg Sonnenberger wrote: >> On Wed, Nov 16, 2011 at 01:14:28PM +, Alexander Best wrote: >>> On Wed Nov 16 11, Joerg Sonnenberger wrote: On Tue, Nov 15, 2011 at 08:24:50PM +, Alexander Best wrote: > one of the

Re: easy way to determine if a stream or fd is seekable

2011-11-16 Thread Alexander Best
On Thu Nov 17 11, Joerg Sonnenberger wrote: > On Wed, Nov 16, 2011 at 01:14:28PM +, Alexander Best wrote: > > On Wed Nov 16 11, Joerg Sonnenberger wrote: > > > On Tue, Nov 15, 2011 at 08:24:50PM +, Alexander Best wrote: > > > > one of the things i'm missing is an easy way to determine, whet

Re: easy way to determine if a stream or fd is seekable

2011-11-16 Thread Joerg Sonnenberger
On Wed, Nov 16, 2011 at 01:14:28PM +, Alexander Best wrote: > On Wed Nov 16 11, Joerg Sonnenberger wrote: > > On Tue, Nov 15, 2011 at 08:24:50PM +, Alexander Best wrote: > > > one of the things i'm missing is an easy way to determine, whether a > > > stream or > > > fd is seekable. i check

Re: easy way to determine if a stream or fd is seekable

2011-11-16 Thread Alexander Best
On Wed Nov 16 11, Alexander Best wrote: > On Wed Nov 16 11, Alexander Best wrote: > > On Wed Nov 16 11, Alexander Best wrote: > > > On Tue Nov 15 11, Brandon Gooch wrote: > > > > On Nov 15, 2011 2:25 PM, "Alexander Best" wrote: > > > > > > > > > > hi there, > > > > > > > > > > one of the things i'

Re: easy way to determine if a stream or fd is seekable

2011-11-16 Thread Alexander Best
On Wed Nov 16 11, Alexander Best wrote: > On Wed Nov 16 11, Alexander Best wrote: > > On Wed Nov 16 11, Alexander Best wrote: > > > On Tue Nov 15 11, Brandon Gooch wrote: > > > > On Nov 15, 2011 2:25 PM, "Alexander Best" wrote: > > > > > > > > > > hi there, > > > > > > > > > > one of the things i'

Re: easy way to determine if a stream or fd is seekable

2011-11-16 Thread Alexander Best
On Wed Nov 16 11, Joerg Sonnenberger wrote: > On Tue, Nov 15, 2011 at 08:24:50PM +, Alexander Best wrote: > > one of the things i'm missing is an easy way to determine, whether a stream > > or > > fd is seekable. i checked the dd(1) and hd(1) sources and those tools are > > performing so much

Re: easy way to determine if a stream or fd is seekable

2011-11-16 Thread Alexander Best
On Wed Nov 16 11, Alexander Best wrote: > On Wed Nov 16 11, Alexander Best wrote: > > On Tue Nov 15 11, Brandon Gooch wrote: > > > On Nov 15, 2011 2:25 PM, "Alexander Best" wrote: > > > > > > > > hi there, > > > > > > > > one of the things i'm missing is an easy way to determine, whether a > > > s

Re: easy way to determine if a stream or fd is seekable

2011-11-16 Thread Alexander Best
On Wed Nov 16 11, Alexander Best wrote: > On Tue Nov 15 11, Brandon Gooch wrote: > > On Nov 15, 2011 2:25 PM, "Alexander Best" wrote: > > > > > > hi there, > > > > > > one of the things i'm missing is an easy way to determine, whether a > > stream or > > > fd is seekable. i checked the dd(1) and h

Re: easy way to determine if a stream or fd is seekable

2011-11-16 Thread Joerg Sonnenberger
On Tue, Nov 15, 2011 at 08:24:50PM +, Alexander Best wrote: > one of the things i'm missing is an easy way to determine, whether a stream or > fd is seekable. i checked the dd(1) and hd(1) sources and those tools are > performing so much stuff just to find out if this is the case, and they stil

Re: easy way to determine if a stream or fd is seekable

2011-11-16 Thread Alexander Best
On Tue Nov 15 11, Brandon Gooch wrote: > On Nov 15, 2011 2:25 PM, "Alexander Best" wrote: > > > > hi there, > > > > one of the things i'm missing is an easy way to determine, whether a > stream or > > fd is seekable. i checked the dd(1) and hd(1) sources and those tools are > > performing so much

Re: easy way to determine if a stream or fd is seekable

2011-11-15 Thread Brandon Gooch
On Nov 15, 2011 2:25 PM, "Alexander Best" wrote: > > hi there, > > one of the things i'm missing is an easy way to determine, whether a stream or > fd is seekable. i checked the dd(1) and hd(1) sources and those tools are > performing so much stuff just to find out if this is the case, and they st

easy way to determine if a stream or fd is seekable

2011-11-15 Thread Alexander Best
hi there, one of the things i'm missing is an easy way to determine, whether a stream or fd is seekable. i checked the dd(1) and hd(1) sources and those tools are performing so much stuff just to find out if this is the case, and they still are doing a very poor job. dd(1) e.g. identifies /dev/ze