in reply to $io->can('seek') == true, but $io->seek(pos, whence) == 'Illegal seek' - bug ?

I suppose that is a buglet, if not a bug. It's not a very important one compared to the handiness of magic opening a pipe from a process and treating it like any other file handle.

Your seekability tests just check that the IO::File object is also in IO::Seekable, which is always true. A better test might look like,

sub IO::File::is_seekable { my $self = shift; eval { $self->seek( $self->tell()) }; not $@; }

If you had gzipped files instead of zipped, I'd recommend the PerlIO::gzip layer. IIRC, that would make the handle seekable. Unfortunately, I don't know of a PerlIO layer for zip files.

After Compline,
Zaxo

  • Comment on Re: $io->can('seek') == true, but $io->seek(pos, whence) == 'Illegal seek' - bug ?
  • Download Code