File: read_bin.Rd

package info (click to toggle)
r-cran-xfun 0.37%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 792 kB
  • sloc: ansic: 242; sh: 22; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 707 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/io.R
\name{read_bin}
\alias{read_bin}
\title{Read all records of a binary file as a raw vector by default}
\usage{
read_bin(file, what = "raw", n = file.info(file)$size, ...)
}
\arguments{
\item{file, what, n, ...}{Arguments to be passed to \code{readBin()}.}
}
\value{
A vector returned from \code{readBin()}.
}
\description{
This is a wrapper function of \code{\link{readBin}()} with default arguments
\code{what = "raw"} and \code{n = \link{file.size}(file)}, which means it
will read the full content of a binary file as a raw vector by default.
}
\examples{
f = tempfile()
cat("abc", file = f)
xfun::read_bin(f)
unlink(f)
}