Re: [Rd] seek() and gzfile() on 32-bit R2.12.0 in linux

From: Peter Dalgaard <pdalgd_at_gmail.com>
Date: Wed, 23 Jun 2010 11:20:01 +0300

Brandon Whitcher wrote:
> I have installed both 32-bit and 64-bit versions of R2.12.0 (2010-06-15
> r52300) on my Ubuntu 10.04 64-bit system.

Please notice that there is NO release of R 2.12.0 until some time around October. You are using a build from the UNSTABLE development branch. The stable branch is 2.11.1 with a release date of May 31. If Ubuntu is claiming that there is such a thing as a R 2.12.0 release, I'd say that they have a problem.

Not that we don't welcome reports on problems in the development branch, but do notice that it is by definition UNSTABLE, and that bugs can come and go without notice.

-pd

 I observe the following behavior
> when running the examples from base::connections. There appears to be a
> problem with seek() on a .gz file when using a 32-bit installation of
> R2.12.0, but the problem doesn't appear in the 64-bit installation. I
> realize that seek() has been difficult in the past, and I don't want to open
> old wounds, but is this a known problem? Is this easily fixable? I have a
> package that relies on seek() when accessing gzipped files.
>
> Using the 32-bit installation...
>
> *> zz <- file("ex.data", "w") # open an output file connection

>>      cat("TITLE extra line", "2 3 5 7", "", "11 13 17", file = zz, sep =

> "\n")
>> cat("One more line\n", file = zz) >> close(zz) >> blah = file("ex.data", "r") >> seek(blah)

> [1] 0
>> zz <- gzfile("ex.gz", "w")  # compressed file
>>      cat("TITLE extra line", "2 3 5 7", "", "11 13 17", file = zz, sep =

> "\n")
>> close(zz) >> blah = file("ex.gz", "r") >> seek(blah)

> [1] 7.80707e+17
>> zz <- bzfile("ex.bz2", "w")  # bzip2-ed file
>>      cat("TITLE extra line", "2 3 5 7", "", "11 13 17", file = zz, sep =

> "\n")
>> close(zz) >> blah = file("ex.bz2", "r") >> seek(blah)

> Error in seek.connection(blah) : 'seek' not enabled for this connection
>> *

>
> Using the 64-bit installation...
>
> *> zz <- file("ex.data", "w") # open an output file connection
>> cat("TITLE extra line", "2 3 5 7", "", "11 13 17", file = zz, sep = "\n")
>> cat("One more line\n", file = zz)
>> close(zz)
>> blah = file("ex.data", "r")
>> seek(blah)

> [1] 0
>> zz <- gzfile("ex.gz", "w")  # compressed file
>> cat("TITLE extra line", "2 3 5 7", "", "11 13 17", file = zz, sep = "\n")
>> close(zz)
>> blah = file("ex.gz", "r")
>> seek(blah)

> [1] 0
>> zz <- bzfile("ex.bz2", "w")  # bzip2-ed file
>> cat("TITLE extra line", "2 3 5 7", "", "11 13 17", file = zz, sep = "\n")
>> close(zz)
>> blah = file("ex.bz2", "r")
>> seek(blah)

> Error in seek.connection(blah) : 'seek' not enabled for this connection
>> *

>
> thanks,
>
> Brandon
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd.mes_at_cbs.dk  Priv: PDalgd_at_gmail.com

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed 23 Jun 2010 - 08:21:59 GMT

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 Wed 23 Jun 2010 - 11:21:11 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