similar to: seek(), skip by bits (not by bytes) in binary file

Displaying 20 results from an estimated 1000 matches similar to: "seek(), skip by bits (not by bytes) in binary file"

2014 Apr 26
2
[LLVMdev] Proposal: add intrinsics for safe division
I am very much in favor of having a div instruction with well defined div-by-zero and overflow behavior. The undefined behavior on certain values for LLVM intrinsics has been a major pain point for us in Julia, because adding the extra branches just kills performance and we know that there is an X86 instruction that just does what we want. Anyway, this was brought up briefly above, but want to
2013 May 08
1
getting corrupted data when using readBin() after seek() on a gzfile connection
Hi, I'm running into more issues when reading data from a gzfile connection. If I read the data sequentially with successive calls to readBin(), the data I get looks ok. But if I call seek() between the successive calls to readBin(), I get corrupted data. Here is a (hopefully) reproducible example. See my sessionInfo() at the end (I'm not on Windows, where, according to the man page,
2009 May 18
2
readBin on binary non-blocking connections (Windows & Unix differences/bugs)
R-devel: I am encountering a consistency issue using socketConnection and readBin with *non-blocking* connections on Unix and Windows XP (no Vista to test). I am a bit confused by the behavior of *non-blocking* connections under Windows specifically. When calling readBin on a non-blocking connection when there is no data to read on the socket, the connection under Unix will return a vector of
2006 Jun 28
2
read file with readBin (the file was saved with a C-routine)
Hello! I have problems with using of "readBin" to read files, which was written in C with "fwrite". In the C-File there is the following Code: fwrite(MyitINI,sizeof(itINItype),1,outfile); where MyitINI is a structure of the following form typedef struct{ int KernelFileSave; /* Determined, if Systemmatrix saved or not.*/ char KernelFileName[200]; /* A-Matrix name
2006 Oct 21
2
Possible bugs in 'seek' and 'readBin'
I found that seek(..., origin = 'current', ...) and readBin(..., what = 'integer', ...) or 'int' do not work correctly. Did anyone have the same experience?
2004 Jun 01
2
Importing binary data
Hi everybody! I've a large dataset, about 2 Mio entries of the format which I would like to import into a frame: <integer><integer><float><string><float><string><string> Because to the huge data amount I've choosen a binary format instead of a text format when exporting from Matlab. My import function is attached below. It works fine for only
2007 Jan 26
1
readBin is much slower for raw input than for a file
Dear all, I'm trying to write an efficient binary file reader for a file type that is made up of several fields of variable length, and so requires many small reads. Doing this on the file directly using a sequence of readBin() calls is a bit too slow for my needs, so I tried buffering the file into a raw vector and reading from that ("loc" is the equivalent of the file pointer):
2007 Jan 26
1
readBin is much slower for raw input than for a file
Dear all, I'm trying to write an efficient binary file reader for a file type that is made up of several fields of variable length, and so requires many small reads. Doing this on the file directly using a sequence of readBin() calls is a bit too slow for my needs, so I tried buffering the file into a raw vector and reading from that ("loc" is the equivalent of the file pointer):
2019 Nov 18
2
readBin should check that its endian argument is a legal value
I think it would be helpful if readBin checked that its endian argument is a legal value. Why? I was reviewing some of our code and noticed that the author had readBin(..., endian="network") and never having heard of "network", I looked at the man page for readBin, and it hadn't heard of "network" either. Not good. I then looked at the R code for readBin, which
2002 Mar 05
3
reading 2-byte integers using readBin and connections
Hi folks: This may be a stupid question, but I cannot seem to find a way to tell readBin that I want to read 2-byte integers from the connection. The input file is 150,720 bytes long containing 75,360 short (2-byte) integers. But specifying "integer" or "int" for what in readBin only returns me a vector of length 37680, leading me to believe that sizeof(integer) or
2006 Nov 07
1
reading VERY large binary files
Hello, I am trying to read in elements out of a very large binary file ... the total file is 4 gigs. I want to select rows out of the file, and the current procedure I run works but is prohibitively slow (takes more than a day to run and still won't complete). Is there any faster way to accomplish this? My current procedure looks like this: readHH <- function(file_name,
2006 Sep 27
2
Single Precision (4 byte) floats with readBin
I would like to use readBin to read a binary data file. Most of the data is 4-byte floating point but, for some reason, only double precision appears to be offered. I tried fVariable=readBin(iFile,what=single()); and got 35.87879 which looks believable except that the correct value is 3.030303. I then tried fVariable=readBin(iFile,what=single(),4); and got [1] 3.831111e+10 6.657199e+10
2011 Mar 29
2
Reading 64-bit integers
Dear all, I see from some previous threads that support for 64-bit integers in R may be an aim for future versions, but in the meantime I'm wondering whether it is possible to read in integers of greater than 32 bits at all. Judging from ?readBin, it should be possible to read 8-byte integers to some degree, but it is clearly limited in practice by R's internally 32-bit integer type:
2009 Dec 17
1
Problem reading binaries created with fortran (More infos)
The structure of the file is clear (see below) the first line is made of integers and doubles with the fifth being a text string followed by arrays of double precision number.: int1 int2 double1 double2 text int3 int4 int5 (array of double) here is an example of file: 1 1 1.0 1.0 "HEAD" 160 224 3 23.4 34.5 ...... I tried to read the first line with readBin (results are copied below):
2006 Jun 02
1
Typo fix for readBin.Rd
Hi, The man page for readBin has a small typo: --- a/src/library/base/man/readBin.Rd +++ b/src/library/base/man/readBin.Rd @@ -58,7 +58,7 @@ writeBin(object, con, size = NA, endian \code{readBin} and \code{writeBin} read and write C-style zero-terminated character strings. Input strings are limited to 10000 - characters. \code{\link{readChar}} and \code{\code{writeChar}} +
2007 Dec 31
1
readBin differences on Windows and Linux/mac
I have been trying to use the gunzip function in the R.utils package. It opens a connection to a gzfile, uses readBin to read from that connection, and then uses writeBin to write out the raw data to a new file. This works as expected under linux/mac, but under Windows, I get: Error in readBin(inn, what= raw(0), size = 1, n=BFR.SIZE) : negative length vectors are not allowed A simple
2009 Nov 25
3
Test Binary File
I've got an error with the way I'm using readBin on a binary file of unknown internal structure. I know the structure consists of rows and columns, but I'm not sure how many of each. So, does anyone know of a valid test set of binary data that I could reference while trying to figure out the technique of using readBin? It would be really helpful to try out readBin on a readily
2008 Aug 22
2
How I can read the binary file with "different type"?
Hi all, I have a binary file which have 8*100 bytes. The structure of the file is as follows: every eigth bytes represent 2 data:the first four bytes is the little-endian for integer, the next four bytes is the little-endian for floating32. The structure of the following bytes is as the same as the first eight bytes'. As the function readBin only read the binary file with one structure
2009 Jul 27
1
read binary file seek()
I want to read in a binary file using the readBin() function. In order to skip uninformative parts of the file I use the seek() function, I need to specify the number of bits to skip rather than the number of bytes to skip. E.g. seek(to.read,origin="current",blockSize) with blockSize giving the number of bits Does anybody know if this works? Any help would be highly
2005 Oct 12
1
Questions about readBin function (Was: dec2bin?)
Hi, The latest version of R had some changes to functions "readbin() and writeBin() [which] now support raw vectors as well as filenames and connections.". As a result I am working on retiring "raw2bin" and "bin2raw" functions from "caTools" package which do exactly the same. Thanks to Prof. Ripley for bringing this change to my attention. Which brings me