[Rd] Issue with seek() on gzipped connections in R-devel

From: Jon Clayden <jon.clayden_at_gmail.com>
Date: Fri, 23 Sep 2011 14:58:32 +0100

Dear all,

In R-devel (2011-09-23 r57050), I'm running into a serious problem with seek()ing on connections opened with gzfile(). A warning is generated and the file position does not seek to the requested location. It doesn't seem to occur all the time - I tried to create a small example file to illustrate it, but the problem didn't occur. However, it can be seen with a file I use for testing my packages, which is available through the URL

> con <- gzfile("~/Downloads/maskedb0_lia.nii.gz","rb")
> seek(con, 352)

[1] 0
Warning message:
In seek.connection(con, 352) :
  seek on a gzfile connection returned an internal error
> seek(con, NA)

[1] 190

The same commands with the same file work as expected in R 2.13.1, and have worked over many previous versions of R.

> con <- gzfile("~/Downloads/maskedb0_lia.nii.gz","rb")
> seek(con, 352)

[1] 0
> seek(con, NA)

[1] 352

My sessionInfo() output is:

R Under development (unstable) (2011-09-23 r57050) Platform: x86_64-apple-darwin11.1.0 (64-bit)

[1] en_GB.UTF-8/en_US.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] splines stats graphics grDevices utils datasets methods [8] base

other attached packages:
[1] tractor.nt_2.0.1 tractor.session_2.0.3 tractor.utils_2.0.0 [4] tractor.base_2.0.3 reportr_0.2.0

This seems to occur whether or not R is compiled with "--with-system-zlib". I see some zlib-related changes mentioned in the NEWS, but I don't see any indication that this is expected. Could anyone shed any light on it, please?

Thanks and all the best,

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 23 Sep 2011 - 14:03:40 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 23 Sep 2011 - 16:30:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive