~showard314/ubuntu/karmic/r-base/remove_start_comments

« back to all changes in this revision

Viewing changes to src/library/base/man/readChar.Rd

  • Committer: Bazaar Package Importer
  • Author(s): Dirk Eddelbuettel
  • Date: 2009-01-19 12:40:24 UTC
  • mfrom: (5.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090119124024-abxsf4e0y7713w9m
Tags: 2.8.1-2
debian/control: Add another Build-Depends: exclusion for the 
'kfreebsd-i386 kfreebsd-amd64 hurd-i386' architecture to openjdk-6-jdk.
Thanks to Petr Salinger for the heads-up.               (Closes: 512324)

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
  the duration of the function call.
44
44
 
45
45
  If the connection is open it is read/written from its current
46
 
  position.  If it is not open, it is opened for the duration of the call
47
 
  and then closed again.  Connections can be open in either text or
48
 
  binary mode.
 
46
  position.  If it is not open, it is opened for the duration of the
 
47
  call in an appropriate mode (binary read or write) and then closed
 
48
  again.  An open connection must be in binary mode.
49
49
  
50
50
  If \code{readChar} is called with \code{con} a raw vector, the data in
51
51
  the vector is used as input.  If \code{writeChar} is called with
53
53
  should be returned.  
54
54
 
55
55
  Character strings containing ASCII \code{nul}(s) will be read
56
 
  correctly by \code{readChar} and appear with embedded nuls in the
57
 
  character vector returned.  \code{writeChar} can write strings with
58
 
  embedded \code{nul}s, and for such strings inteprets \code{nchar} as
59
 
  the number of bytes to be written.
 
56
  correctly by \code{readChar} but truncated at the first
 
57
  \code{nul} with a warning.
60
58
  
61
59
  If the character length requested for \code{readChar} is longer than
62
60
  the data available on the connection, what is available is
75
73
}
76
74
 
77
75
\note{
 
76
  Earlier versions of \R allowed embedded nul bytes within character
 
77
  strings, but not \R >= 2.8.0.  \code{readChar} was commonly used to
 
78
  read fixed-size zero-padded byte fields for which \code{readBin} was
 
79
  unsuitable.  \code{readChar} can still be used for such fields if
 
80
  there are no embedded nuls: otherwise \code{readBin(what="raw")}
 
81
  provides an alternative.
 
82
  
78
83
  \code{nchars} will be interpreted in bytes not characters in a
79
84
  non-UTF-8 multi-byte locale, with a warning.
80
85