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

Peter Dalgaard pdalgd at gmail.com
Wed Jun 23 10:20:01 CEST 2010


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



More information about the R-devel mailing list