On 11/05/2009 7:05 AM, Johannes Graumann wrote:
Hello,

With the help of "seek" I can start "readBin" from any byte offset within my file that I deem appropriate. What I would like to do is to be able to define the endpoint of that read as well. Is there any solution to that already out there?

Sure: just use the "n" parameter to readBin. This will work for any type except character, but it doesn't make sense to read those in a given range: what do you do if the last one is not zero terminated? If you want the end of block to count as a terminator, then read the block as raw, add a null to the end, and then re-read the raw vector.

Duncan Murdoch

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to