similar to: Typo fix for readBin.Rd

Displaying 20 results from an estimated 5000 matches similar to: "Typo fix for readBin.Rd"

2002 Nov 29
2
readBin or writeBin adds extra nulls (PR#2333)
Full_Name: Ken Yap Version: 1.6.1 OS: Linux (SuSE 8.0) Submission from: (NULL) (129.78.64.5) I'm trying to copy a file using readBin and writeBin. (The reason is to be able to pipe PostScript or PDF output to a socket later, this is just an experiment.) I do: zz <- file("foo.ps", "rb") r <- readBin(zz, character(), 1000000) yy <- file("bar.ps",
2003 Nov 14
2
writeChar potential buffer overrun (PR#5090)
Trying to copy the (binary) header of a input file directly to an output file, I've had repeatable seg faults. The call: writeChar(hdr, outfh, nchars=6144) when hdr just contains one empty string seems to be the culprit. The stack traces weren't all that illuminating, with sig 11 in memory-related functions following this. But in src/main/connections.c it looks like do_writechar
2001 Dec 07
2
Memory problem
Dear all, I have written a little R program to convert images. See below. Within the loop over j (the filenames) memory consumption grows constantly. rm( ... ) inside the loop did not help. Memory does not grow if I remove the writeBin statements between the two #-------- marks. But obviously this is not solution I want... Thanks for any advice. Manfred Baumstark P.S. As I'm new to R:
2002 Apr 26
4
Memory "leak" in readChar (PR#1483)
Full_Name: Hugh C. Pumphrey Version: 1.4.1 OS: Linux (Debian Woody) Submission from: (NULL) (129.215.133.170) The function readChar() appears to have some type of problem with memory allocation. I don't know if "memory leak" is the correct term but if one uses readChar() many times, the R binary grows in size until it eats all your memory and swap space. The code enclosed below
2006 Mar 30
1
Writing character vectors with embedded nulls to a connection
Is this possible? I've tried both writeChar() and writeBin() to no avail. My goal is to serialize(ascii=FALSE) an object to a connection but determine the size of the serialized object before hand: sobject <- serialize(object,NULL,ascii=FALSE) len <- nchar(sobject) # # run some code here to notify listener on other end of connection # how many bytes I'm getting ready to send #
2002 Jun 18
3
Maybe a problem in binary read/write (PR#1688)
Full_Name: Johnny Accot Version: 1.5.1 OS: Linux Submission from: (NULL) (198.4.83.52) Hi. I'm having a problem with the binary read/write functions. I'm writing a device driver in R (why not?) and of course I have to send a couple commands to the device. Typically, I send one byte, receive one acknowledgement byte, send another byte, receive an ACK, and so on. At least this is what
2012 May 03
2
Help with readBin
I'm trying to read a binary file created by a fortran code using readBin and readChar. Everything reads fine (integers and strings) except for double precision numbers, they are read as huge or very small number (1E-250,...). I tried various endianness, swap, But nothing has worked so far. I also tried on R 64 bit for linux and windows (R 2.14) and R 2.11 on windows XP 32 bit. Any help would
2011 Feb 04
2
Strange behaviour of read and writeBin
To me it seems like writeBin() writes one char/byte more than expected. > con <- file("testbin", "wb") > writeBin("ttccggaa", con) > close(con) > con <- file("testbin", "rb") > readBin(con, what="character") [1] "ttccggaa" > seek(con, what=NA) [1] 9 > close(con) > con <-
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
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,
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
2007 Jul 08
0
patch to enhance sound module for 96 kHz/24 bit sample sizes
Greetings Matthias, Thanks again for your sound module. I did not ever manage to find the time to play with phase equations, but I found I needed the module for a new project involving bats. I needed to do some work @ 96 kHz/24 bit sample size, and found the limitations of the sound package stop at 48 kHz and 16 bit samples. Here's a patch to bring things up to 96/24. Sorry I cannot
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,
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
2001 Jul 17
1
How to write the bytes 00 01 00 to a file/connection?
Is there any way to write (8-bit) bytes to a file which works on all [R] platforms? I have been looking at 1) writeBin 2) writeChar 3) cat and neither of them manage to write arbitrary sequences of bytes (0-255). For instance, I would like to create a binary file of length three containing the bytes 0, 1 and 0. I [R] I have the following vector of bytes: bfr <- c(0,1,0) 1) For
2007 Jun 14
1
Clarification for readChar man page
Hi, Here's a patch to the readChar manual page (R-trunk as of today) that better clarifies readChar's return value. It could use some work as I'd also like to add some text about using nchar() to find the length of the string that readchar() returns, but I'm unsure which of type="bytes" or type="chars" to mention. Is it type="chars"? Index:
2003 Nov 06
2
Summary: How to represent pure linefeeds chr(10) under R for Windows
Thanks to all who have responded. My concern was to be able to write a csv file that can have line feeds in string columns chr(10). Why? Excel allows line feeds chr(10) within cells and line breaks chr(13)+chr(10) at line ending, but the windows version of R automatically replaces \n by \r\n in writing and \r\n by \n in reading (text mode). The clues for a solution came from Brian Ripley and
2024 Feb 17
1
certain pipe() use cases not working in r-devel
I've now tested with: > R.version.string [1] "R Under development (unstable) (2024-02-16 r85931)" and all of the previously mentioned examples now work as expected on macOS. Thanks for the quick fix, Jenny On Thu, Feb 15, 2024 at 8:02?AM Tomas Kalibera <tomas.kalibera at gmail.com> wrote: > > On 2/14/24 23:43, Jennifer Bryan wrote: > > Hello, > > >
2002 Oct 07
2
Error in writeBin(object, con, size = 2)
Hi all, I wrote a function (in R batch mode) which reads binary data, interpolates sometimes and wrote a new binary file of the same size as the input file. Her is a bit of code: while (length( head <- readBin(si, integer(), 64, size=2))) { data <- readBin(si, integer(), head[5], size=2) ## now write head to new file writeBin(head, so, size=2) ## if head[4] is 9 or
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